fix(install): hint flue restart when updating #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Builds the landing site on a pull request, so `check-prose` (site/scripts, | |
| # run by `pnpm build`) is a gate rather than a report. Before this file the | |
| # check only ran after a merge: ci.yml's `make lint test` never reaches site/, | |
| # and deploy-site.yml runs on push to main alone. | |
| # | |
| # A file of its own rather than a job in ci.yml because path filtering in | |
| # Actions lives on the trigger, not on the job — ci.yml runs on everything | |
| # and cannot carry a `paths:` without narrowing all of it. | |
| # | |
| # README.md and scripts/install.sh are in the paths because check-prose reads | |
| # both by name, so either can turn this red with site/ untouched. | |
| name: site | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "site/**" | |
| - "README.md" | |
| - "scripts/install.sh" | |
| - ".github/workflows/site.yml" | |
| pull_request: | |
| paths: | |
| - "site/**" | |
| - "README.md" | |
| - "scripts/install.sh" | |
| - ".github/workflows/site.yml" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install the toolchain from mise.toml | |
| uses: jdx/mise-action@v4 | |
| # mise-action caches the tools it installs, but not the pnpm store; | |
| # cache it separately, keyed on the lockfile. site/ is its own pnpm | |
| # workspace, so it needs its own key — ci.yml's hashes web/ and relay/. | |
| - name: Locate the pnpm store | |
| id: pnpm-store | |
| run: echo "path=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT" | |
| - name: Cache the pnpm store | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.pnpm-store.outputs.path }} | |
| key: pnpm-store-site-${{ runner.os }}-${{ hashFiles('site/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| pnpm-store-site-${{ runner.os }}- | |
| - name: Install the site's dependencies | |
| working-directory: site | |
| run: pnpm install --frozen-lockfile | |
| # Build before lint, which looks backwards and is not: `lint` is | |
| # tsc --noEmit, and src/routeTree.gen.ts is gitignored and written by the | |
| # router's vite plugin, so on a fresh checkout there is no copy to typecheck | |
| # against and tsc fails on `Cannot find module './routeTree.gen'`. The build | |
| # is also what check-prose reads — it scans the prerendered dist/client. | |
| # | |
| # Three attempts because the prerender step fetches each route out of a | |
| # vite preview server on an ephemeral port and loses a race with it often | |
| # enough to matter: measured at 1 build in 8, 3 in 12 and 4 in 6, failing | |
| # as `connect ETIMEDOUT ::1:<port>` and `ECONNREFUSED 127.0.0.1:<port>` on | |
| # the port nothing is listening on yet. A required check that red-lights at | |
| # that rate teaches people to press re-run without reading, and then it | |
| # stops catching anything. | |
| # | |
| # Every measurement was macOS, and the error shapes are macOS-flavoured, so | |
| # this may be precautionary here — see the note in the commit. It is a | |
| # workaround for a flake and not a licence for a broken build: each attempt | |
| # announces itself, so a real failure reads as three real failures. Drop it | |
| # if the runs stay green without it, or when the prerender's own retryCount | |
| # is set in vite.config.ts and fixes this where it happens. | |
| - name: Build the site | |
| working-directory: site | |
| run: | | |
| for attempt in 1 2 3; do | |
| echo "::group::Build attempt $attempt of 3" | |
| if pnpm build; then | |
| echo "::endgroup::" | |
| exit 0 | |
| fi | |
| echo "::endgroup::" | |
| echo "::warning::Site build attempt $attempt of 3 failed. If the log above ends in a prerender fetch error, it is the port race; anything else is real." | |
| done | |
| echo "::error::Site build failed three times. Three failures is not the flake — read the first attempt's log." | |
| exit 1 | |
| - name: Lint the site | |
| working-directory: site | |
| run: pnpm lint |