GitHub Actions is a powerful CI/CD platform integrated directly into your GitHub repository.
- Workflow: An automated process defined in a YAML file.
- Event: A trigger that starts a workflow (e.g., push, pull_request).
- Job: A set of steps that execute on a runner.
- Step: An individual task, either a shell command or an action.
- Action: A reusable unit of code.
- Runner: A server that runs your workflows.
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.- Automated testing (unit, integration)
- Building and packaging applications
- Deploying to cloud providers (AWS, Azure, GCP)
- Publishing packages to registries (npm, Docker Hub)
- Automating repository management tasks