Skip to content

Commit

Permalink
use wrangler-action
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Sep 14, 2024
1 parent 7494545 commit 821e3ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,11 @@ jobs:
run: pnpm build-all

- name: Deploy to Cloudflare
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CI_CF_PAGES }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: ${{ env.PAGES_PROJECT_NAME }}
directory: dist-cf
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'
command: pages deploy dist-cf --project-name=${{ env.PAGES_PROJECT_NAME }}

- name: Setup Github Pages
uses: actions/configure-pages@v5
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/build-with-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ jobs:
run: pnpm build-all

- name: Deploy to Cloudflare
uses: cloudflare/pages-action@1
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CI_CF_PAGES }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: ${{ env.PAGES_PROJECT_NAME }}
directory: dist-cf
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'
command: pages deploy dist-cf --project-name=${{ env.PAGES_PROJECT_NAME }}

- name: Setup Github Pages
uses: actions/configure-pages@v5
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/previews-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,23 @@ jobs:
run: pnpm build-cf

- name: Deploy preview to Cloudflare
uses: cloudflare/pages-action@1
id: pages-action
uses: cloudflare/wrangler-action@v3
id: wrangler-action
with:
apiToken: ${{ secrets.CI_CF_PAGES }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
projectName: ${{ env.PAGES_PROJECT_NAME }}
directory: dist
branch: ${{ github.head_ref || github.ref_name }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'
command: pages deploy dist --project-name=${{ env.PAGES_PROJECT_NAME }} --branch=${{ github.head_ref || github.ref_name }}

- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
with:
message: |
Deployed ${{ steps.pages-action.outputs.environment }} build to Cloudflare!
Deployed build to Cloudflare!
| | |
| ----------------------- | - |
| **Last commit:** | ${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha || github.sha }} |
| **Preview URL**: | ${{ steps.pages-action.outputs.url }} |
| **Preview URL**: | ${{ steps.wrangler-action.outputs.deployment-url }} |
| **Branch Preview URL**: | https://${{ github.head_ref || github.ref_name }}.${{ env.PAGES_PROJECT_URL_SLUG }}.pages.dev |
comment_tag: deployment
mode: upsert

0 comments on commit 821e3ef

Please sign in to comment.