Skip to content

Commit 37de45a

Browse files
Fix docs production deployment
Ensure release-triggered docs publishes deploy to the Cloudflare Pages production branch instead of always creating preview deployments. Co-Authored-By: multicode <multicode@yawk.at>
1 parent 91d1609 commit 37de45a

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/docs.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,30 @@ jobs:
3535
- name: Build documentation
3636
if: github.event_name != 'workflow_dispatch' || !inputs.selected_version
3737
run: cd docs && just all
38-
- name: Publish
38+
- name: Publish production
39+
if: github.event_name == 'release'
3940
uses: cloudflare/wrangler-action@v3
40-
id: cf_publish
41+
id: cf_publish_production
42+
with:
43+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
44+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
45+
command: pages deploy docs/target/site/ --project-name=lz4-java-yawk-at --branch=main
46+
- name: Publish preview
47+
if: github.event_name != 'release'
48+
uses: cloudflare/wrangler-action@v3
49+
id: cf_publish_preview
4150
with:
4251
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
4352
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
4453
command: pages deploy docs/target/site/ --project-name=lz4-java-yawk-at
4554
- name: Check PR
55+
if: github.event_name != 'release'
4656
uses: 8BitJonny/gh-get-current-pr@3.0.0
4757
id: pr
4858
- name: Comment on PR
4959
if: steps.pr.outputs.pr_found
5060
uses: thollander/actions-comment-pull-request@v3
5161
with:
52-
message: ":rocket: Preview deployed to ${{steps.cf_publish.outputs.deployment-url}}"
62+
message: ":rocket: Preview deployed to ${{steps.cf_publish_preview.outputs.deployment-url}}"
5363
comment-tag: deployment
5464
pr-number: "${{steps.pr.outputs.number}}"

0 commit comments

Comments
 (0)