Skip to content

Commit

Permalink
ci: use cloudflare/pages-action instead and add a step to comment URL
Browse files Browse the repository at this point in the history
  • Loading branch information
LuqiPan committed Mar 27, 2024
1 parent 56a16bb commit 50f3e25
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/build-deploy-doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,23 @@ jobs:
yarn install
yarn docs:build-cf
# Based on https://github.com/cloudflare/wrangler-action?tab=readme-ov-file#deploy-your-pages-site-production--preview
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
- name: Publish to Cloudflare Pages
id: publish-to-cloudflare-pages
uses: cloudflare/pages-action@v1
with:
wranglerVersion: '3'
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 0c4635effffcd7f36d1b9f0425a4367a
command: pages deploy --project-name=documentation dist/
projectName: documentation
directory: dist/

- name: Comment with preview URL
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body:${{ steps.publish-to-cloudflare-pages.outputs.url }}
})

0 comments on commit 50f3e25

Please sign in to comment.