QuickDevGuide

Home › GitHub Actions

Best Practices — GitHub Actions

Do's # Practice Reason 1 Cache dependencies NuGet, pnpm, Pub — 2-5x faster builds 2 Use concurrency groups Cancel older runs on same PR 3 Pin action versions actions/checkout@v4 not @main 4 Use path filters Only build what changed 5 Use reusable workflows DRY across services 6 Add timeouts timeout-minutes: 15 — prevent hanging jobs 7 Use environments Staging → approval → production Don'ts # Anti-pattern Correct Approach 1 Store secrets in YAML Use repository secrets 2 Skip tests in CI Tests are the point of CI 3 Use latest image tag Use SHA-based or semver tags 4 Run on every push Use path filters and branch restrictions 5 Use continue-on-error Failures should fail the pipeline The fastest way to learn GitHub Actions is to build one real workflow end to end: PR validation, Docker build…

Key Takeaways