Skip to content

Commit 8580f77

Browse files
committed
Update React, move to GitHub Actions for Pages deployment
1 parent 529b7d1 commit 8580f77

2 files changed

Lines changed: 57 additions & 13 deletions

File tree

.github/workflows/pages.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: '24'
28+
29+
- name: Install dependencies
30+
run: npm install --legacy-peer-deps
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v3
37+
with:
38+
path: ./build
39+
40+
deploy:
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
44+
runs-on: ubuntu-latest
45+
needs: build
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

package.json

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
{
22
"name": "reactar",
33
"version": "0.1.0",
4-
"homepage": "http://hexcube.github.io/ReactAR",
4+
"homepage": "http://RohanVilloth.github.io/ReactAR",
55
"private": true,
66
"dependencies": {
7-
"@testing-library/jest-dom": "^4.2.4",
8-
"@testing-library/react": "^9.5.0",
9-
"@testing-library/user-event": "^7.2.1",
10-
"react": "^16.13.1",
11-
"react-dom": "^16.13.1",
12-
"react-scripts": "3.4.3"
7+
"@testing-library/jest-dom": "^5.16.5",
8+
"@testing-library/react": "^13.4.0",
9+
"@testing-library/user-event": "^13.5.0",
10+
"react": "^18.2.0",
11+
"react-dom": "^18.2.0",
12+
"react-scripts": "5.0.1"
1313
},
1414
"scripts": {
1515
"start": "react-scripts start",
1616
"build": "react-scripts build",
1717
"test": "react-scripts test",
18-
"eject": "react-scripts eject",
19-
"predeploy": "npm run build",
20-
"deploy": "gh-pages -d build"
18+
"eject": "react-scripts eject"
2119
},
2220
"eslintConfig": {
2321
"extends": "react-app"
@@ -33,8 +31,5 @@
3331
"last 1 firefox version",
3432
"last 1 safari version"
3533
]
36-
},
37-
"devDependencies": {
38-
"gh-pages": "^3.1.0"
3934
}
4035
}

0 commit comments

Comments
 (0)