ci: add GitHub Actions workflow to build and deploy to GitHub Pages

This commit is contained in:
2026-04-07 21:51:52 +07:00
parent 935e6edc6f
commit 9adf5b20a2
2 changed files with 47 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
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: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm test
- run: npm run build
- 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
+1
View File
@@ -3,6 +3,7 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
base: "/try-superpowers/",
plugins: [react()],
test: {
globals: true,