GitHub Actions (Unified Workflow)
Overview
Modern CI/CD patterns for monorepos focusing on efficiency, path-based execution, and automated release cycles. This skill prioritizes the "Unified Workflow" architecture used in Firstsun projects.
When to Apply
Use this skill when:
- Setting up CI/CD for a monorepo (pnpm workspaces).
- Implementing path-based job filtering to reduce CI costs and time.
- Automating Cloudflare Workers/Pages deployment.
- Integrating
semantic-releasefor automated versioning and tagging. - Configuring self-hosted runners or specific environments (NAS/Backup sites).
Quick Reference
- Path Filtering: Use
dorny/paths-filterto detect changes in specific apps or packages. - Needs Mechanism: Chain jobs using
needsto ensure correct execution order (Prepare -> App Jobs -> Deploy -> Release). - Environment Isolation: Define shared variables at the top-level
envand sensitive secrets in GitHub Settings. If the repo is public, don't assume org-level secrets/variables referenced by a workflow (e.g.${{ secrets.FOO }}) are actually reachable — check their visibility first, since org secrets can be scoped toall,private, orselectedrepos:
A workflow that references a secret scoped to private repos will silently receive an empty value on a public repo, not an error — this is a common source of "works in one repo, fails in another" CI bugs.gh secret list --org firstsun-dev gh variable list --org firstsun-dev gh api orgs/firstsun-dev/actions/secrets/<SECRET_NAME> --jq '.visibility' - Self-hosted Runners: Specify
runs-on: self-hostedfor internal infrastructure deployment. - Action Versions: Always pin to the latest major version of each action, matching what
firstsun-dev/.github(org-wide workflows repo) uses (e.g.actions/checkout@v6,actions/setup-node@v6,pnpm/action-setup@v6,dorny/paths-filter@v4,actions/upload-artifact@v7,actions/download-artifact@v8). Check the local clone's.github/workflows/andactions/setup/action.ymlfor the current authoritative versions before writing a new workflow — don't rely on stale examples. - Node Version: Default to the latest LTS (currently Node 24); Node 22 is the minimum supported floor.
- Lint Before Committing: Run scripts/lint-workflows.sh against any new or edited workflow before pushing. It runs actionlint (downloading a pinned binary into
.cache/if not already on PATH) to catch YAML/expression syntax errors, bad action inputs/outputs, andrun:shell issues that only otherwise surface after a failed CI run.
References
| File | Description |
|---|---|
| unified-workflow.md | Template for a unified monorepo CI/CD pipeline |
| cloudflare-deploy.md | Deployment patterns for Cloudflare Workers and D1 |
Problem -> Skill Mapping
| Problem | Start With |
|---|---|
| Setup a full CI/CD pipeline from scratch | unified-workflow.md |
| Automate Cloudflare Workers deployment | cloudflare-deploy.md |
| Validate a workflow file before pushing | scripts/lint-workflows.sh |