tweak utils #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy React App to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
# Build job | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4.1.7 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4.0.2 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: | | |
cd react | |
npm install | |
- name: Build the React app | |
run: | | |
cd react | |
npm run build | |
env: | |
CI: false # bypass ESLint | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3.0.1 | |
with: | |
path: ./react/build | |
# Deploy job | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |