Skip to content

Commit 51313ab

Browse files
authored
fix: Update release.yml (#204)
Try a new order of steps.
1 parent 1da7991 commit 51313ab

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,6 @@ jobs:
5353

5454
- run: npm i
5555
- run: npm run build-all
56-
57-
- name: Check if the dist branch exists remotely
58-
run: |
59-
if git ls-remote --exit-code --heads origin dist; then
60-
# Delete the dist branch locally if it exists
61-
if git show-ref --verify --quiet refs/heads/dist; then
62-
git branch -D dist
63-
fi
64-
# Delete the dist branch remotely
65-
git push origin --delete dist
66-
fi
67-
68-
- name: Checkout and create dist branch from main
69-
run: git checkout -b dist main
70-
71-
- name: Add and commit changes to the dist folder
72-
run: |
73-
git add dist
74-
if [[ -n $(git status --porcelain) ]]; then
75-
git commit -m "Update dist folder"
76-
git push origin dist
77-
else
78-
echo "No changes to commit"
79-
fi
8056

8157
- uses: google-github-actions/auth@v1
8258
with:
@@ -87,3 +63,11 @@ jobs:
8763

8864
- name: Deploy to Firebase Hosting
8965
run: firebase deploy --only hosting
66+
67+
- name: Force Checkout dist and Overwrite
68+
run: |
69+
git fetch origin main
70+
git checkout -B dist origin/main
71+
git add dist
72+
git commit -m "Update dist folder"
73+
git push --force origin dist

0 commit comments

Comments
 (0)