File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,36 @@ jobs:
12
12
runs-on : ubuntu-latest
13
13
14
14
steps :
15
+ # 1. Checkout the repository
15
16
- name : Checkout repository
16
17
uses : actions/checkout@v3
17
18
19
+ # 2. Setup Node.js environment
18
20
- name : Setup Node.js
19
21
uses : actions/setup-node@v3
20
22
with :
21
23
node-version : " 16" # Specify Node.js version
22
24
25
+ # 3. Install project dependencies
23
26
- name : Install dependencies
24
27
run : npm install
25
28
29
+ # 4. Build the React app
26
30
- name : Build React app
27
31
run : npm run build
28
32
33
+ # 5. Deploy to GitHub Pages using PAT and git commands
29
34
- name : Deploy to GitHub Pages
30
- uses : peaceiris/actions-gh-pages@v3
31
- with :
32
- github_token : ${{ secrets.DEPLOY_TOKEN }}
33
- publish_dir : ./build
34
- publish_branch : main
35
- destination_repo : stacchain/stacchain.github.io
36
- user_name : " jonhealy1" # Replace with your GitHub username
37
- user_email :
" [email protected] " # Replace with your GitHub email
35
+ env :
36
+ GITHUB_TOKEN : ${{ secrets.DEPLOY_TOKEN }}
37
+ run : |
38
+ git config --global user.name "jonhealy1"
39
+ git config --global user.email "[email protected] "
40
+ git remote add deploy https://jonhealy1:${GITHUB_TOKEN}@github.com/stacchain/stacchain.github.io.git
41
+ git fetch deploy
42
+ git checkout deploy/main || git checkout --orphan deploy/main
43
+ git rm -rf .
44
+ cp -R build/* .
45
+ git add .
46
+ git commit -m "Deploy React app to GitHub Pages [skip ci]"
47
+ git push deploy deploy/main --force
You can’t perform that action at this time.
0 commit comments