Skip to content

Commit 9da5282

Browse files
authored
fix: Adds simplified checkout flow. (#174)
1 parent efff027 commit 9da5282

File tree

1 file changed

+5
-41
lines changed

1 file changed

+5
-41
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -74,46 +74,10 @@ jobs:
7474
- name: Deploy to Firebase Hosting
7575
run: firebase deploy --only hosting
7676

77-
- name: Check if the dist branch exists remotely
78-
run: |
79-
if git ls-remote --exit-code --heads origin dist; then
80-
# Delete the dist branch locally if it exists
81-
if git show-ref --verify --quiet refs/heads/dist; then
82-
git branch -D dist
83-
fi
84-
# Delete the dist branch remotely
85-
git push origin --delete dist
86-
fi
87-
88-
- name: Checkout and create dist branch from main
89-
run: git checkout -b dist main
90-
91-
- name: Commit and Push Changes (to dist)
77+
- name: Force Checkout dist and Overwrite
9278
run: |
79+
git fetch origin main # Ensure we have the latest main
80+
git checkout -B dist origin/main # Force checkout of dist, overwriting with main
9381
git add dist
94-
if git diff --staged --quiet; then
95-
echo "No changes to commit"
96-
else
97-
git commit -m "Update dist folder [skip ci]"
98-
99-
# --- ADD THESE DEBUGGING STEPS ---
100-
echo "--- Before Push ---"
101-
echo "Current Branch:"
102-
git branch
103-
echo "Remote Branches:"
104-
git branch -r
105-
echo "Local Branches:"
106-
git branch -l
107-
echo "Last Commit on dist (local):"
108-
git log -n 1 dist
109-
echo "Pushing to origin dist..."
110-
# --- END DEBUGGING STEPS ---
111-
112-
git push origin dist
113-
114-
# --- ADD THESE DEBUGGING STEPS ---
115-
echo "--- After Push ---"
116-
echo "Remote Branches (after push):"
117-
git branch -r
118-
# --- END DEBUGGING STEPS ---
119-
fi
82+
git commit -m "Update dist folder [skip ci]"
83+
git push --force origin dist # Force push to dist

0 commit comments

Comments
 (0)