About these GitHub Actions snippets
These are workflow files I run in production repositories, not toy examples. Every snippet has been through the cycle of "it works on my machine" to "why did this fail at 3am" to "okay, now it actually works." The YAML you see here handles the edge cases the official docs skim over: caching gotchas, conditional execution, secret handling, and concurrency control.
All workflows target the latest GitHub-hosted runners (Ubuntu) and use pinned action versions with SHA hashes where it matters for supply chain safety.
What's inside
- CI pipelines: a full Next.js CI workflow with lint, typecheck, and build in a single job, plus matrix builds across multiple Node.js versions for library testing.
- Caching: npm dependency caching with proper cache key strategies, so your CI runs finish in seconds instead of minutes.
- Releases: automated GitHub Releases triggered by semantic version tags, with changelog generation and artifact uploads.
- Smart skipping: conditionally skip CI when only documentation files changed, saving runner minutes on docs-only PRs.
- PR automation: post sticky preview comments on pull requests using
github-script, with automatic updates on subsequent pushes. - Scheduled jobs: cron-based workflows that hit secured endpoints, useful for cache warming, health checks, and scheduled data syncs.
More workflows land here as I extract them from active repositories. If a workflow pattern saves CI minutes or prevents a class of deployment bugs, it ends up in this collection.
How to use them
Every snippet page shows the complete workflow YAML, explains the non-obvious parts, and lists the secrets and permissions you need to configure. Copy the YAML into .github/workflows/, set the required secrets in your repo settings, and push. The snippets are designed to work as standalone workflows. You can combine them, but each one is self-contained.
If you spot a cheaper way to run a job or a better caching strategy, the code is open on GitHub. PRs and issues are welcome.