· 2 min read
CI that checks PRs and deploys only from main
Removed actions/configure-pages. Nothing used its outputs.
What we did
- Removed
actions/configure-pages. Nothing used its outputs. - Split
check,lintandbuildinto separate CI steps. - Gated the artifact upload and the
deployjob withif: github.ref == 'refs/heads/main', so PRs only build and check. - Moved
concurrency: pagesfrom the top level into thedeployjob, so PR checks don't queue behind deploys. - Ran
pnpm formaton the repo and enabled format on save in.vscode/settings.json. Recommended the Prettier extension. - Started a blog post explaining the workflow (
content/blog/, still a draft).
What I learned
- Each job runs on its own fresh VM. The Pages artifact is how
build/gets from the build job to the deploy job. - You don't deploy from a PR. A merged PR is a push to
main. github.refis safer thangithub.event_name: a manual run from a feature branch hasevent_name == workflow_dispatchbut the wrong ref.- Inside
if:there's no${{ }}, and strings use single quotes. pnpm lint(prettier --check) only reports.pnpm format(prettier --write) fixes. Here "lint" is only formatting; there's no ESLint yet.- Commit project-wide
.vscode/settings, and keep personal preferences in User settings.
Problems & fixes
- The ruleset had no status checks to choose from. A check only appears after it has run at least once, so open a PR first and then create the ruleset.
Next
- Write the README, open the PR, confirm
deployis skipped, add the ruleset, merge. - Phase 1: TypeScript migration.