Skip to content

Commit 674b465

Browse files
authored
Don't fail after-ci deploy-docs-preview if PR docs job failed (#3302)
1 parent 756f1d2 commit 674b465

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/after-ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
name: deploy-docs-preview
4646

4747
steps:
48+
- run: echo "$GITHUB_EVENT_JSON"
49+
env:
50+
GITHUB_EVENT_JSON: ${{ toJSON(github.event) }}
51+
4852
- uses: actions/checkout@v4
4953

5054
- uses: actions/setup-node@v4
@@ -57,7 +61,8 @@ jobs:
5761
enable-cache: true
5862
cache-suffix: deploy-docs-preview
5963

60-
- uses: dawidd6/action-download-artifact@v6
64+
- id: download-artifact
65+
uses: dawidd6/action-download-artifact@v6
6166
with:
6267
workflow: ci.yml
6368
name: site
@@ -69,6 +74,7 @@ jobs:
6974

7075
- uses: cloudflare/wrangler-action@v3
7176
id: deploy
77+
if: steps.download-artifact.outputs.found_artifact == 'true'
7278
with:
7379
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
7480
environment: previews
@@ -78,12 +84,9 @@ jobs:
7884
--var GIT_COMMIT_SHA:${{ github.event.workflow_run.head_sha }}
7985
--var GIT_BRANCH:${{ github.event.workflow_run.head_branch }}
8086
81-
- run: echo "$GITHUB_EVENT_JSON"
82-
env:
83-
GITHUB_EVENT_JSON: ${{ toJSON(github.event) }}
84-
8587
- name: Set preview URL
8688
run: uv run --no-project --with httpx .github/set_docs_pr_preview_url.py
89+
if: steps.deploy.outcome == 'success'
8790
env:
8891
DEPLOY_OUTPUT: ${{ steps.deploy.outputs.command-output }}
8992
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)