Skip to content

Commit 026aac2

Browse files
committed
update workflow
1 parent afb272f commit 026aac2

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,33 @@ jobs:
3838
set -x
3939
git config --global user.name "jonhealy1"
4040
git config --global user.email "[email protected]"
41-
git remote add deploy https://jonhealy1:${DEPLOY_TOKEN}@github.com/stacchain/stacchain.github.io.git
41+
42+
# Remove existing deploy remote if it exists to avoid conflicts
43+
git remote remove deploy || true
44+
45+
# Add deploy remote using PAT for authentication
46+
git remote add deploy https://x-access-token:${DEPLOY_TOKEN}@github.com/stacchain/stacchain.github.io.git
47+
48+
# Verify remote URLs
49+
git remote -v
50+
51+
# Fetch the deploy branch
4252
git fetch deploy
53+
54+
# Checkout to deploy/main or create an orphan branch if it doesn't exist
4355
git checkout deploy/main || git checkout --orphan deploy/main
56+
57+
# Remove all existing files
4458
git rm -rf .
59+
60+
# Copy build files to the repository root
4561
cp -R build/* .
62+
63+
# Add all changes
4664
git add .
65+
66+
# Commit changes
4767
git commit -m "Deploy React app to GitHub Pages [skip ci]"
68+
69+
# Push changes to deploy/main with force
4870
git push deploy deploy/main --force

0 commit comments

Comments
 (0)