mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 13:19:20 +00:00
44 lines
964 B
YAML
44 lines
964 B
YAML
name: Deploy React App
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
# defaults:
|
|
#run:
|
|
# working-directory: src/frontend
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Navigate to project
|
|
run: cd src/frontend && echo "PROJECT_DIR=$(pwd)" >> $GITHUB_ENV
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
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: Deploy
|
|
working-directory: src/frontend
|
|
run: npx gh-pages -d build
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|