Skip to content

Commit 20d3cd8

Browse files
committed
try custom deploy
1 parent d6f1a1f commit 20d3cd8

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.github/workflows/deploy.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,36 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15+
# 1. Checkout the repository
1516
- name: Checkout repository
1617
uses: actions/checkout@v3
1718

19+
# 2. Setup Node.js environment
1820
- name: Setup Node.js
1921
uses: actions/setup-node@v3
2022
with:
2123
node-version: "16" # Specify Node.js version
2224

25+
# 3. Install project dependencies
2326
- name: Install dependencies
2427
run: npm install
2528

29+
# 4. Build the React app
2630
- name: Build React app
2731
run: npm run build
2832

33+
# 5. Deploy to GitHub Pages using PAT and git commands
2934
- 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

0 commit comments

Comments
 (0)