From 33ac91e33982c59f84a6dbe80b71d558797f8331 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Thu, 22 Jan 2026 22:50:47 +0300 Subject: [PATCH] ci: build & deploy to GH pages Signed-off-by: NotAShelf Change-Id: Ieedfca23ce8b2b52ebae5b81095973056a6a6964 --- .github/workflows/deploy.yml | 55 ++++++++++++++++++++++++++++++++++++ vite.config.ts | 1 + 2 files changed, 56 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..09aa79c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,55 @@ +name: Build and Deploy + +on: + workflow_dispatch: + push: + branches: [main] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node + uses: actions/setup-node@v6 + with: + node-version: 22 + cache: pnpm + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build + run: GITHUB_PAGES=true pnpm run build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v4 + with: + path: dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/vite.config.ts b/vite.config.ts index 9379593..80980da 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,7 @@ import solidPlugin from 'vite-plugin-solid'; export default defineConfig({ plugins: [solidPlugin()], + base: process.env.GITHUB_PAGES ? '/nix-evaluator-stats/' : './', server: { port: 3000, open: false,