Skip to content

Commit aa157d7

Browse files
authored
fix: Update release.yml (#213)
* fix: Update release.yml Changes release.yml: - Checkout main branch initially - Checkout dist branch - Remove the contents of dist/samples - Copy samples, then add ONLY those samples. - Push the changes. * Update release.yml amend git add line
1 parent 73789ae commit aa157d7

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,21 @@ jobs:
2424
runs-on: ubuntu-latest
2525
permissions:
2626
contents: write
27-
id-token: write # Needed for Firebase
27+
id-token: write
2828
env:
2929
GOOGLE_MAPS_JS_SAMPLES_KEY: "${{ secrets.GOOGLE_MAPS_JS_SAMPLES_KEY }}"
3030
steps:
31-
- name: Checkout dist
31+
- name: Checkout main
3232
uses: actions/checkout@v3
3333
with:
34-
ref: dist # Checkout the *dist* branch initially.
34+
ref: main # Checkout *main* initially
3535
token: ${{ secrets.GH_MERGE_TOKEN }}
3636
fetch-depth: 0
3737

3838
- name: Set Git Identity
3939
run: |
4040
git config --global user.name 'googlemaps-bot'
4141
git config --global user.email '[email protected]'
42-
43-
- name: Fetch main
44-
run: git fetch origin main:main
45-
46-
- name: Copy Files from Main (Except dist)
47-
run: |
48-
git checkout main -- .
49-
rm -rf dist
5042
5143
- uses: actions/cache@v3
5244
with:
@@ -71,13 +63,18 @@ jobs:
7163

7264
- name: Deploy to Firebase Hosting
7365
run: firebase deploy --only hosting
74-
66+
67+
- name: Checkout dist branch
68+
run: git checkout -B dist origin/dist || git checkout -b dist
69+
70+
- name: Clear dist/samples
71+
run: rm -rf dist/samples/*
72+
73+
- name: Copy Built Output to dist/samples
74+
run: cp -r dist/samples/* dist/samples/
75+
7576
- name: Commit and Push Changes (to dist)
7677
run: |
77-
git add dist
78-
if git diff --staged --quiet; then
79-
echo "No changes to commit"
80-
else
81-
git commit -m "Update dist folder"
82-
git push --force origin dist
83-
fi
78+
git add dist/*
79+
git commit -m "Update dist folder"
80+
git push --force origin dist

0 commit comments

Comments
 (0)