From f3d065e6109894ed58b8a9723b6b0c06d5961f6d Mon Sep 17 00:00:00 2001 From: Samuel Prevost Date: Tue, 14 Apr 2026 23:28:36 +0200 Subject: [PATCH] ci: add GitHub Actions workflow for GitHub Pages deployment - pnpm 10 + Node 22 for fastest CI - Frozen lockfile, upload-pages-artifact v3, deploy-pages v4 - Vite base path set to /skwik/ when building in GHA - Concurrency group cancels in-progress deploys Co-Authored-By: Claude --- .github/workflows/deploy.yml | 50 ++++++++++++++++++++++++++++++++++++ vite.config.ts | 1 + 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e5bccab --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + with: + version: 10 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + + - run: pnpm install --frozen-lockfile + + - run: pnpm build + env: + NODE_OPTIONS: --max-old-space-size=4096 + + - uses: actions/upload-pages-artifact@v3 + with: + path: dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/vite.config.ts b/vite.config.ts index f3a546c..2a8120d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,7 @@ import tailwindcss from "@tailwindcss/vite"; import { resolve } from "node:path"; export default defineConfig({ + base: process.env.GITHUB_ACTIONS ? "/skwik/" : "/", plugins: [vue(), tailwindcss()], resolve: { alias: {