How to Create a GitHub Actions Workflow
Learn the fundamentals of creating GitHub Actions workflows for continuous integration and delivery.
What is a GitHub Actions Workflow?
A workflow is a configurable automated process that runs one or more jobs. Workflows are defined by a YAML file checked into your repository.
Step 1: Create the directory
GitHub Actions looks for workflow files in a specific directory. In the root of your repository, create the folder path .github/workflows/.
Step 2: Add a YAML file
Create a file inside that directory, e.g., ci.yml. Define the name of the workflow and the event that triggers it (e.g., on: push).
Step 3: Define jobs and steps
Inside the YAML file, define jobs that run on specific runners (e.g., ubuntu-latest) and list the steps to execute, such as checking out code and running tests.