gisedaye / write-docker-actions Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://lab.github.com/githubtraining/github-actions:-write-docker-container-actions
License: MIT License
Home Page: https://lab.github.com/githubtraining/github-actions:-write-docker-container-actions
License: MIT License
Hello @gisedaye, I'm so excited to teach you how to create your own custom Docker based action ๐
GitHub Actions are enabled on your repository by default, but we still have to tell our repository to use them. We do this by creating a workflow file in our repository.
A workflow file can be thought of as the recipe for automating a task. They house the start-to-finish instructions, in the form of jobs
and steps
, for what should happen based on specific triggers.
Your repository can contain multiple workflow files that carry out a wide variety of tasks. It is important to consider this when deciding on a name for your workflow. The name you choose should reflect the tasks being performed.
In our case, we will use this one workflow file for many things, which leads us to break this convention for teaching purposes.
๐ Read more about workflows
@gisedaye we are going to start with the typical "Hello World" example and build something more complex after, but first let's decide if a Docker based action is the right action for us!
That's a super great question to ask. Before we talk about the components that make up Docker based actions, we should understand the good and the bad of Docker based actions.
Advantages | Disadvantages |
---|---|
Docker actions package the source code that will be executed right alongside any dependencies that source code has. | Slower execution time because the image containing your source code and dependencies gets built with every workflow run. |
Docker containers package the environment with the GitHub Actions code. This creates a more consistent and reliable unit of work because the consumer of the action does not need to worry about the tools or dependencies. | Docker container actions can only execute in the GitHub-hosted Linux environment. |
Ideal for running in environments with very specific configurations and tools. | Debugging can be difficult with containers. |
Actions can be written in any language you choose. | More files to maintain when changes to the action occur. |
Let's begin by exploring the components of a Docker based action and discuss how they fit together!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.