2025-06-05 21:25:25 +08:00

45 lines
983 B
YAML

name: Deploy React App from src/frontend
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/frontend
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build project
run: pnpm run build
- name: Configure Git identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Deploy to GitHub Pages
run: npx gh-pages -d build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}