Introduction to Github Actions
Introduction
It is a Continuous integration
and continuous delivery
(CI/CD) platform allow you to automate your build, test, and deployment. You can build and test every pull request in your repository or deploy merged pull requests to production.
You can run workflows when other events happen in your repository with the help of GitHub Actions
. Whenever someone creates a new issue in your repository, you can run a workflows to automatically add the appropriate labels.
If you want to host your own runners
in your own data center or cloud infrastructure, you can use the virtual machines provided by GitHub
.
Ingredients of GitHub Actions
A pull request being opened or an issue being created can be triggered by a GitHub Actions workflow
. One or more jobs can run in sequential order or in parallel
. Each job will run inside its own virtual machine runner, or inside a container, and has one or more steps that either run a script that you define or run an action, which is a reuse extension
that can simplify your workflows.
Workflows
- A process that runs one or more jobs is called a
workflows
. - When triggered by an event in your repository, a YAML file will be checked in to your repository and will be used to define a set of processes.
- A repository can have
multiple workflows
, each of which can perform a different set of tasks.
Events
- An event is a
specific activity
in a repository. - When someone creates a pull request, opens an issue, or pushes a commit to a repository, activity can originate from GitHub.
- You can post a run on a schedule or manually.
Jobs
- A job is a
set of steps
in a process. - The action that will be run is either a
shell script
or an action that will be executed. - The steps are
dependent
on each other. -
Data can be shared
from one step to another if each step is executed on the same runner. - A step that builds your application can be followed by a step that tests it.
- By default,
jobs have no dependency
and run in parallel with each other. - When a job takes a dependency on another job, it will
wait for the other job to finish
before it can run.
Actions
- An action is a
custom application
that performs a complex butfrequently repeated task
. - You can use an action to help reduce the amount of repetitive code you write.
- You can pull your git repository from GitHub, set up the correct toolchain for your build environment, or set up the authentication to your cloud provider with an action.
Runners
- A runner is a server that runs your workflows.
- Runners can run a single job at a time.
- Each run executes in a fresh,
newly-provisioned virtual machine
. - To run your workflows, GitHub provides Ubuntu Linux, Microsoft Windows, and macOS runners.
- You can host your own runners if you need a different operating system.
Kindly refer the article for Introduction to Github Actions - Part 2
Thanks for reading my article till end. I hope you learned something special today. If you enjoyed this article then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box.
Top comments (0)