# devops - GitHub Actions
# overview
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.
# GHA YAML API documentation
About YAML syntax for workflows
# workflow
A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.
Workflows are defined in the .github/workflows
directory in a repository.
You can reference a workflow within another workflow. For more information, see Reusing workflows.
# event
An event is a specific activity in a repository that triggers a workflow run. For example, activity can originate from GitHub when someone creates a pull request, opens an issue, or pushes a commit to a repository.
# job
A job is a set of steps
in a workflow that is executed on the same runner.
Each step is either a shell script that will be executed, or an action that will be run.
Steps are executed in order and are dependent on each other.
Since each step is executed on the same runner, you can share data from one step to another.
For example, you can have a step that builds your application followed by a step that tests the application that was built.
Each job is executed on a dedicated runner, see this issue for impacts.
# shared jobs
Jobs can be shared between workflows.
# action
An action is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task. Use an action to help reduce the amount of repetitive code that you write in your workflow files.
You can write your own actions, or you can find actions to use in your workflows in the GitHub Marketplace.
Finding and customizing actions
# common actions
# repo checkout
# platform set up
# persist data
# using an action in a job step
YAML jobs.<job_id>.steps[*].uses
# runner
A runner is a server that runs your workflows when they're triggered. Each runner can run a single job at a time. GitHub provides Ubuntu Linux, Microsoft Windows, and macOS runners to run your workflows; each workflow run executes in a fresh, newly-provisioned virtual machine.
# define the runner in a job
# cache management
- Caching dependencies to speed up workflows
- GitHub Actions — How To Share Data Between Jobs
- `bahmutov/npm-install@v1
- Do Not Let NPM Cache Snowball on CI