From d57d68e610c6272933a9519c6bdf581ea6c73c13 Mon Sep 17 00:00:00 2001 From: Cian Monnin Date: Tue, 12 May 2026 16:07:26 -0400 Subject: [PATCH 1/2] ci: replace node-build with a build+deploy workflow - Runs build on every PR (currently the workflow only runs on push to main) - corepack honours the packageManager pnpm pin (current CI globally installs latest pnpm) - pnpm install --frozen-lockfile catches lockfile drift - Deploy step gated to main only, so PRs can never deploy - pnpm store caching via setup-node --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/node-build.yml | 50 -------------------------------- 2 files changed, 45 insertions(+), 50 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/node-build.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9dd325d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI / Deploy + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22.x" + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm build + env: + VITE_BASE: /${{ github.event.repository.name }}/ + - uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + deploy: + if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/node-build.yml b/.github/workflows/node-build.yml deleted file mode 100644 index 5823bca..0000000 --- a/.github/workflows/node-build.yml +++ /dev/null @@ -1,50 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow one concurrent deployment -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: "22.x" - - run: npm install -g pnpm - - run: pnpm install - - run: pnpm build - env: - VITE_BASE: /PictureNamingTask/ - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload dist folder - path: "./dist" - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 From 0a530af478e46e1b7fca20518b1ceefb20562075 Mon Sep 17 00:00:00 2001 From: Cian Monnin Date: Tue, 12 May 2026 16:15:51 -0400 Subject: [PATCH 2/2] ci: drop pnpm cache to mitigate cache-poisoning class of attacks Removes `cache: pnpm` from setup-node. The pnpm cache was the vehicle in the @tanstack/* supply-chain incident (https://tanstack.com/blog/incident-followup); for a small static- site repo the ~30s install cost is worth the simpler threat model. --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9dd325d..ed0a4f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: "22.x" - cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm build env: