Skip to main content
The repository uses six workflow files in .github/workflows/ covering continuous integration, automated releases, static site deployment, and branch policy enforcement.

Workflow overview

ci.yml

Runs unit tests and Lighthouse CI on every PR targeting preview. Required to pass before merge.

release.yml

Runs semantic-release on every push to main. Creates version tags, CHANGELOG entries, and GitHub Releases.

deploy-storybook.yml

Deploys Storybook to GitHub Pages on pushes to main that touch component files. Also manually triggerable.

sync-preview.yml

Merges main back into preview after every successful release. Sends a Discord notification on success or failure.

enforce-preview-branch.yml

Blocks PRs into main from any branch other than preview.

enforce-preview-source.yml

Blocks manual PRs from main into preview — that direction is handled automatically by sync-preview.yml.

ci.yml — Continuous Integration

Trigger: Pull requests targeting the preview branch.

Jobs

unit-tests — Runs the full Vitest suite:
lighthouse — Builds the Astro site and runs Lighthouse CI:
Lighthouse CI runs with continue-on-error: true so that a Lighthouse regression does not block an otherwise-passing PR. The results still appear as a status check in the PR. Install the LHCI GitHub App and set LHCI_GITHUB_APP_TOKEN to get inline performance annotations on the PR.

Required GitHub variables

The Lighthouse build job reads these from the repository’s Variables (not secrets):

release.yml — Semantic Release

Trigger: Pushes to main.
fetch-depth: 0 is required so semantic-release can read the full git history to determine the version bump from commit messages. RELEASE_TOKEN must be a Personal Access Token (not the default GITHUB_TOKEN) because semantic-release pushes a commit back to main (the changelog commit), and push-to-protected-branch requires a PAT.

deploy-storybook.yml — Storybook Deploy

Trigger: Pushes to main touching astro-app/src/**, astro-app/.storybook/**, or astro-app/package.json. Also manually triggerable via workflow_dispatch. See Deploying Sanity Studio for the full workflow source and configuration details.

sync-preview.yml — Preview Sync

Trigger: Runs automatically after every successful Release workflow completes.
After a successful merge, a Discord embed is posted:
Preview branch synced preview is now in sync with main at abc1234. Safe to pull and branch from preview.
If the merge fails (e.g., due to a conflict), a failure embed is posted with a link to the Actions run.
The sync workflow uses secrets.RELEASE_TOKEN (a PAT) to push to preview. Make sure this token has Contents: write scope and is not expired.

enforce-preview-branch.yml — Main Branch Guard

Trigger: Pull requests targeting main.
This workflow fails (and blocks merge) if the PR source branch is anything other than preview. It enforces the git workflow rule that main only accepts merges from preview.

enforce-preview-source.yml — Preview Branch Guard

Trigger: Pull requests targeting preview.
Blocks manual PRs from mainpreview. The sync-preview.yml workflow handles this direction automatically after every release, so manual PRs from main are unnecessary and potentially disruptive.

Secrets and variables reference