Skip to content

Commit cf61082

Browse files
committed
fix: Adds functionality of post-build script directly to release.
1 parent ddd4cb7 commit cf61082

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,29 @@ jobs:
7575
- name: Deploy to Firebase Hosting
7676
run: firebase deploy --only hosting
7777

78-
- name: Post Build
79-
run: samples/post-build.sh
78+
- name: Check if the dist branch exists remotely
79+
run: |
80+
if git ls-remote --exit-code --heads origin dist; then
81+
# Delete the dist branch locally if it exists
82+
if git show-ref --verify --quiet refs/heads/dist; then
83+
git branch -D dist
84+
fi
85+
# Delete the dist branch remotely
86+
git push origin --delete dist
87+
fi
88+
89+
- name: Checkout and create dist branch from main
90+
run: git checkout -b dist main
91+
92+
- name: Add and commit changes to the dist folder
93+
run: |
94+
git add dist
95+
git add index.html
96+
if [[ -n $(git status --porcelain) ]]; then
97+
git commit -m "Update dist folder"
98+
git push origin dist
99+
else
100+
echo "No changes to commit"
80101
81102
approve-and-merge:
82103
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)