ci: build & deploy to GH pages

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ieedfca23ce8b2b52ebae5b81095973056a6a6964
This commit is contained in:
raf 2026-01-22 22:50:47 +03:00
commit 33ac91e339
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
2 changed files with 56 additions and 0 deletions

55
.github/workflows/deploy.yml vendored Normal file
View file

@ -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

View file

@ -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,