-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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