mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 13:19:20 +00:00
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: Deploy React App
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
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: 22
|
|
cache: 'pnpm'
|
|
cache-dependency-path: 'src/frontend/pnpm-lock.yaml'
|
|
|
|
- name: Install dependencies
|
|
working-directory: src/frontend
|
|
run: pnpm install
|
|
|
|
- name: Build
|
|
working-directory: src/frontend
|
|
run: pnpm run build
|
|
|
|
- name: Copy 404.html
|
|
working-directory: src/frontend
|
|
run: cp build/index.html build/404.html
|
|
|
|
- name: Deploy to GitHub Pages
|
|
working-directory: src/frontend
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
npx gh-pages -d build -u "github-actions[bot] <github-actions[bot]@users.noreply.github.com>" --repo "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
|