File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,33 @@ jobs:
38
38
set -x
39
39
git config --global user.name "jonhealy1"
40
40
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
42
52
git fetch deploy
53
+
54
+ # Checkout to deploy/main or create an orphan branch if it doesn't exist
43
55
git checkout deploy/main || git checkout --orphan deploy/main
56
+
57
+ # Remove all existing files
44
58
git rm -rf .
59
+
60
+ # Copy build files to the repository root
45
61
cp -R build/* .
62
+
63
+ # Add all changes
46
64
git add .
65
+
66
+ # Commit changes
47
67
git commit -m "Deploy React app to GitHub Pages [skip ci]"
68
+
69
+ # Push changes to deploy/main with force
48
70
git push deploy deploy/main --force
You can’t perform that action at this time.
0 commit comments