-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.15 KB
/
deploy.yml
File metadata and controls
46 lines (39 loc) · 1.15 KB
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
44
45
46
name: Deploy to GitHub Pages
permissions:
contents: write # Required to push to the repository
pages: write # Required for GitHub Pages deployment
on:
push:
branches:
- main # Make sure you have the correct name of your branch here
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v2
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Adjust Node.js version as needed
# Install dependencies
- name: Install dependencies
run: |
npm install
# Build the app
- name: Build the app
run: |
npm run build
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # Branch where the app will be deployed
folder: dist # Folder containing the built React app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically generated token for authentication