Skip to content

class mode

class mode #3

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main
- master
# Allow manual trigger from the Actions tab
workflow_dispatch:
permissions:
contents: write # needed for gh-pages branch push
jobs:
build-and-deploy:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
# 1. Checkout source code
- name: Checkout
uses: actions/checkout@v4
# 2. Set up Node.js (matches local dev env)
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
# 3. Install dependencies
- name: Install dependencies
run: npm ci
# 4. Build production bundle (Vite reads base from vite.config.js)
- name: Build
run: npm run build
# 5. Push dist/ to gh-pages branch
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages
force_orphan: true # keep gh-pages history clean
commit_message: "deploy: ${{ github.sha }}"