GitHub Actions Concepts
GitHub Actions is GitHub's built-in automation system for CI/CD and other repository-driven workflows.
Core Ideas
- A workflow is defined in YAML.
- A workflow contains one or more jobs.
- A job contains steps.
- Steps run shell commands or reusable actions.
Typical Uses
- Run tests on pull requests.
- Build artifacts or container images.
- Deploy after merges to the main branch.
Example Workflow
name: PR workflow
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./test_script.sh
Practical Notes
- Keep workflows small and explicit.
- Use secrets for credentials and tokens.
- Prefer reusable actions when a step is repeated across repositories.