Skip to content

Commit 6af0aba

Browse files
committed
Add GitHub Pages
1 parent f95d5c8 commit 6af0aba

File tree

3 files changed

+384
-0
lines changed

3 files changed

+384
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy React App to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: 'pages'
15+
cancel-in-progress: true
16+
17+
jobs:
18+
deploy:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v3
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: '20.x'
32+
cache: 'npm'
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Build the React app
38+
run: npm run build
39+
40+
- name: Configure GitHub Pages
41+
uses: actions/configure-pages@v3
42+
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v1
45+
with:
46+
path: './dist'
47+
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)