donate page #22
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 CRA site to GitHub Pages | |
on: | |
# Trigger the workflow on push to the main branch | |
push: | |
branches: | |
- main | |
# Trigger the workflow on manual runs | |
workflow_dispatch: | |
permissions: | |
contents: write # Needed for deployment to GitHub Pages | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- name: Checkout repository | |
uses: actions/checkout@v3 # Updated to the latest version | |
# Set up Node.js environment | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 # Updated to the latest version | |
with: | |
node-version: '20.x' # Specify your desired Node.js version | |
# Install dependencies in the client folder | |
- name: Install dependencies | |
run: npm install | |
working-directory: client | |
# Build the React app in the client folder | |
- name: Build the app | |
run: npm run build | |
working-directory: client | |
# Deploy the app to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # Specify the branch to deploy to | |
folder: client/build # Specify the folder containing the built app |