What are GitHub Actions?
GitHub actions are building blocks that form a continuous integration and continuous deployment (CI/CD) platform that is built right into GitHub. You can create a workflow that trigger actions based on changes in your code repo or other defined triggers.
GitHub actions a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline.
In this post I will be answering the question “What are GitHub Actions?” mainly for the purpose of network automation, which is not the most common use of GitHub actions but is rapidly becoming a very popular use case.
GitHub Actions are created in the .github/workflows folder within your project and are written in YAML. You can have more than one workflow e.g. one to check for pull requests and another to deploy an application.
To get started you can try some done for you actions in the Github Marketplace.
What are GitHub actions Steps ?
A GitHub action consists of three main parts or steps.
An event e.g. a change in a code repository, or if someone pulls a repository triggers a workflow which then triggers an action.
Events can be run on a schedule which runs the workflow on a regular basis. Or you can trigger is manually.
All of the triggers can be combined e.g. a scheduled action can be run manually and also fire on an event.
GitHub actions events that trigger workflows
There are many events that can trigger an event, the most common being a change in a code repository but they can also be configured to trigger when any event happens in GitHub.
Create, Delete, Pull Request etc. The full list can be found here:
GitHub actions workflow examples
A workflow is a YAML file which defines the trigger event, then the action to perform when that event happens. In each workflow there are jobs which run.
For example this simple workflow is listening for a change in a code repository, specifically if someone makes a push and then will print out a message.
For examples that show some more advanced features of Github Actions – check out – https://docs.github.com/en/actions/examples
Sometimes referred to as Gitops
More Git Tutorials
GitHub Actions Related Posts
Frequently asked questions
What is the difference between GitHub and GitHub actions?
GitHub is a code repository hosting website and GitHub Actions are the CI/CD functionality build into the platform.
Do GitHub actions cost money?
Using GitHub Actions is free for standard GitHub-hosted runners in public repositories. Self-hosted runners are also free. For private repositories you will receive an amount of free minutes for runners.
What is the difference between GitHub actions and Gitlab?
GitHub actions are the CI/CD pipeline functionality built into GitHub, GitLab is a separate code hosting platform platform entirely that also has CI/CD functionality.