Objective

Build CI/CD pipelines with GitHub Actions workflows.

Tools & Technologies

  • GitHub Actions
  • YAML
  • CI/CD

Key Commands

gh workflow run
gh run list
gh run watch
cat .github/workflows/ci.yml

Lab Steps

01
Workflow File

Create a .github/workflows/ci.yml with triggers and jobs.

02
Jobs & Steps

Define jobs with steps: checkout, setup, test, build.

03
Secrets

Store and access secrets in GitHub Actions environment.

04
Matrix Strategy

Run tests across multiple OS and language version combinations.

Challenges Encountered

  • Secrets not available on PRs from forks for security
  • Actions cache invalidation when dependency versions change

Key Takeaways

  • Use actions/cache to speed up dependency installation
  • Pin action versions to SHA for security