Skip to content

Commit 7ae8305

Browse files
committed
fix(ci): make deploy workflow depend on bump-docs workflow, improve steps
1 parent 1745a6d commit 7ae8305

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/bump-docs-version.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: "Bump Docs Version"
1+
name: Bump Docs Version
22

33
on:
44
release:
5-
types: [released]
5+
types: [published, released]
66
workflow_dispatch:
77

88
permissions:
@@ -49,8 +49,13 @@ jobs:
4949
echo "Updated docs/package.json to version ${{ steps.extract_version.outputs.version }}"
5050
5151
- name: Commit updated package.json
52+
id: commit
5253
uses: stefanzweifel/git-auto-commit-action@v6
5354
with:
5455
branch: main
5556
commit_message: "chore(docs): bump version to ${{ steps.extract_version.outputs.version }}"
5657
file_pattern: "docs/package.json"
58+
59+
- name: Expose commit SHA
60+
id: meta
61+
run: echo "commit_sha=${GITHUB_SHA}" >> $GITHUB_OUTPUT

.github/workflows/deploy.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Deploy Docs to GH Pages
22

33
on:
4-
release:
5-
types: [published]
6-
4+
workflow_run:
5+
workflows: ["Bump Docs Version"]
6+
types: [completed]
77
# Allows you to run this workflow manually from the Actions tab
88
workflow_dispatch:
99

@@ -53,10 +53,11 @@ jobs:
5353

5454
# Deployment job
5555
deploy:
56+
if: needs.build.result == 'success'
57+
needs: build
5658
environment:
5759
name: github-pages
5860
url: ${{ steps.deployment.outputs.page_url }}
59-
needs: build
6061
runs-on: ubuntu-latest
6162
name: Deploy
6263
steps:

0 commit comments

Comments
 (0)