From 832bd10a839fb70f2a4c22675336b54af30a0723 Mon Sep 17 00:00:00 2001 From: serros404 Date: Mon, 14 Sep 2026 13:27:14 -0300 Subject: [PATCH] ci: build every pull request before it can land MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The deploy workflow only fires on push to main, so nothing built a change before it merged — a broken build was only visible once it was already on main, and by then the site simply stops updating. This adds a build-only check on pull_request. No deploy step, and it does not overlap with main.yml (push vs pull_request). Two deliberate choices: - node-version is pinned to "20" because that is withastro/action@v2's default, which is what deploy actually runs on. Matching it is the point: a green check here means the deploy will build on the same Node. - npm ci rather than npm install, so a lockfile that drifted from package.json fails loudly instead of quietly resolving something else. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01SCGof6E8MrS772HhsYZT5a --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9e6bbeb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +# The deploy workflow only fires on push to main, so until now nothing built a +# change before it landed — a broken build was only visible after the merge. +# This builds every pull request first. +on: + pull_request: + branches: [ main ] + workflow_dispatch: + +# A new push to a PR makes the previous run pointless. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + # Pinned to 20 on purpose: that is withastro/action@v2's default, which is + # what deploy runs on. Matching it is the whole point — a green check here + # means the deploy will build on the same Node. + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: npm + + # npm ci, not npm install: it fails on a lockfile that drifted from + # package.json instead of quietly resolving something else. + - name: Install + run: npm ci + + - name: Build + run: npm run build