Skip to content

Commit 9ffab29

Browse files
authored
gh-pages.yml
1 parent 11987e5 commit 9ffab29

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy React App to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main"] # Runs on pushes to the main branch
6+
workflow_dispatch: # Allows manual runs
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: '16' # Specify a version compatible with your project
20+
21+
- name: Install Dependencies
22+
run: npm install
23+
24+
- name: Build Project
25+
run: npm run build
26+
27+
- name: Deploy to GitHub Pages
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
run: npm run deploy

0 commit comments

Comments
 (0)