CI/CD Pipeline โ
Pixelflare uses GitHub Actions to check every change, and to ship it once it's merged. The workflows live in .github/workflows:
| Workflow | Runs when | What it does |
|---|---|---|
| ๐ฆ CI | A pull request is opened or updated | Lints, tests and builds everything the change touches |
| ๐ Tag | A pull request is merged into main | Bumps the version and pushes a v* tag |
| ๐ Deploy | A v* tag is pushed | Deploys everything to Cloudflare |
| ๐ Release | A v*.*.0 tag is pushed | Drafts a GitHub release with the built workers |
| ๐ช Mirror | A v* tag is pushed, and weekly | Copies the repo to Codeberg |
So a merged pull request flows through like this:
flowchart LR
PR[PR Merged] --> Tag[Tag: Bump Version]
Tag --> Deploy[Deploy]
Tag --> Release["Release (v*.*.0 only)"]
Tag --> Mirror[Mirror]
Deploy --> Live[Live!]
style PR fill:#E0E0E0,stroke:#616161,color:#000
style Tag fill:#90CAF9,stroke:#1976D2,color:#000
style Deploy fill:#CE93D8,stroke:#7B1FA2,color:#000
style Release fill:#FFF176,stroke:#F57F17,color:#000
style Mirror fill:#FFF176,stroke:#F57F17,color:#000
style Live fill:#81C784,stroke:#2E7D32,color:#000If you're deploying your own fork with these, see Deploying with GitHub Actions for the secrets you need.
CI โ
ci.yml runs on every pull request, on pushes to main, and on demand. It needs no secrets, so it works for pull requests from forks too.
On a pull request, it first works out which files changed, and only runs the jobs that care about them. A docs-only change skips the tests, for example. Pushes to main run everything.
flowchart LR
Changes[Detect Changes] --> Jobs[Quality, Test, Build, Docs, ...]
Secrets[Secrets Scan] --> Verdict
Jobs --> Verdict{All Passed?}
Verdict -->|Yes| Merge[Ready to Merge]
Verdict -->|No| Blocked[Blocked]
style Changes fill:#E0E0E0,stroke:#616161,color:#000
style Jobs fill:#90CAF9,stroke:#1976D2,color:#000
style Secrets fill:#90CAF9,stroke:#1976D2,color:#000
style Verdict fill:#E1BEE7,stroke:#8E24AA,color:#000
style Merge fill:#81C784,stroke:#2E7D32,color:#000
style Blocked fill:#EF9A9A,stroke:#C62828,color:#000| Job | Runs when these change | What it checks |
|---|---|---|
| ๐งน Lint | Packages or root config | pnpm lint across every package |
| ๐ Format | Packages or root config | pnpm format:check across every package |
| ๐ค Types | Packages or root config | pnpm type-check across every package |
| ๐งช Test | Any package except frontend & docs | pnpm test |
| ๐๏ธ Build | Packages or root config | Every package builds, and the frontend, docs and i18n output exist |
| ๐ Translations | i18n or frontend | Translation keys are valid, and reports coverage |
| ๐ Docs | Packages, Terraform, Makefile | Re-runs pnpm docs:gen and fails if the generated docs are stale |
| โ๏ธ Workers | Any package except frontend & docs | The API and gateway workers bundle with a Wrangler dry run |
| ๐งฌ Migrations | Database migrations | Existing migrations weren't edited, renamed or deleted |
| ๐๏ธ Terraform | terraform/ | terraform fmt and terraform validate |
| ๐ Shell | Shell scripts or Makefile | ShellCheck |
| ๐ค Workflows | .github/ | actionlint and zizmor |
| ๐ Secrets | Always | TruffleHog scans the git history for leaked credentials |
| ๐ Dependencies | package.json or the lockfile | Flags new dependencies with moderate or worse vulnerabilities |
Finally, ๐ค Final Verdict collects every result into one summary table, and fails if any job did. That's the one check a pull request needs to pass.
Most of these you can run before pushing, with pnpm hold-my-beer. It regenerates the docs, then lints, type checks, formats and tests everything. See Commands for the rest.
Tag โ
tag.yml runs when a pull request is merged into main. Every package deploys together, so the whole repo shares one version, kept in the root package.json.
- If the pull request changed something that ships (
packages/,terraform/,scripts/, the Claude Code plugin, theMakefileor the lockfile), it bumps the patch version, commits it tomain, and pushes av*tag - If the pull request already bumped the version itself, it uses that one instead
- If nothing that ships changed, it does nothing
You can also run it by hand from main, with a version number or blank for the next patch. It pushes with a personal access token (BOT_TOKEN), since tags pushed with GitHub's built-in token don't start other workflows.
Deploy โ
deploy.yml deploys a tagged commit to production, and can also be run by hand. Its steps are the same make targets that make deploy runs locally, so you can test any of them on your own machine:
- Setup: Node, pnpm and Terraform, then builds
.envfrom the GitHub secrets - Pre-flight checks: tools, credentials and domain
- Infrastructure: Terraform apply, the resources Terraform can't manage, then the Wrangler config
- Build: installs dependencies, type checks, runs the tests and builds every package
- Database: applies new D1 migrations
- Deploy: the workers, then the frontend, then these docs
- Secrets: sets the Worker secrets
- Smoke tests: checks the live deployment responds
Deploys run one at a time, and a new one never cancels one that's already running.
Release โ
release.yml drafts a GitHub release for tags ending in .0, like v1.3.0. Patch tags still deploy, they just don't get a release.
Each release includes the source, the built API and gateway worker bundles, and their checksums. The builds are reproducible, so anyone can rebuild a tag and compare its checksum with the bundle_sha256 that a running instance reports at /v1/status.
Mirror โ
mirror.yml copies the repo to Codeberg on every tag, and once a week.
Keeping Actions Up to Date โ
Every third-party action is pinned to a commit hash, so a compromised tag can't change what runs. Dependabot opens weekly pull requests to update them, along with the npm dependencies.