From 3ea7805f83b7e2e0608db7ca8750d7d74a18ab08 Mon Sep 17 00:00:00 2001 From: Marcus Date: Sat, 14 Sep 2024 10:58:06 -0700 Subject: [PATCH 1/2] use `wrangler-action` --- .github/workflows/build-deploy.yml | 7 ++----- .github/workflows/build-with-image.yml | 7 ++----- .github/workflows/previews-cf.yml | 14 +++++--------- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 3780a24f1..0e22a1c45 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -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 diff --git a/.github/workflows/build-with-image.yml b/.github/workflows/build-with-image.yml index 7aea7dd6c..1b4b28d75 100644 --- a/.github/workflows/build-with-image.yml +++ b/.github/workflows/build-with-image.yml @@ -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 diff --git a/.github/workflows/previews-cf.yml b/.github/workflows/previews-cf.yml index 0cfd062e3..38e21ea25 100644 --- a/.github/workflows/previews-cf.yml +++ b/.github/workflows/previews-cf.yml @@ -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@v3 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 From 36bceb3d44dd9590aa40f61547848c3079949b59 Mon Sep 17 00:00:00 2001 From: Marcus Date: Wed, 27 Nov 2024 12:48:43 -0800 Subject: [PATCH 2/2] use wrangler-action github deployments? maybe? --- .github/workflows/build-deploy.yml | 1 + .github/workflows/build-with-image.yml | 1 + .github/workflows/previews-cf.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 0e22a1c45..81a23f69d 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -71,6 +71,7 @@ jobs: apiToken: ${{ secrets.CI_CF_PAGES }} accountId: ${{ secrets.CF_ACCOUNT_ID }} command: pages deploy dist-cf --project-name=${{ env.PAGES_PROJECT_NAME }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} - name: Setup Github Pages uses: actions/configure-pages@v5 diff --git a/.github/workflows/build-with-image.yml b/.github/workflows/build-with-image.yml index 1b4b28d75..78f283898 100644 --- a/.github/workflows/build-with-image.yml +++ b/.github/workflows/build-with-image.yml @@ -54,6 +54,7 @@ jobs: apiToken: ${{ secrets.CI_CF_PAGES }} accountId: ${{ secrets.CF_ACCOUNT_ID }} command: pages deploy dist-cf --project-name=${{ env.PAGES_PROJECT_NAME }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} - name: Setup Github Pages uses: actions/configure-pages@v5 diff --git a/.github/workflows/previews-cf.yml b/.github/workflows/previews-cf.yml index 38e21ea25..c41415b12 100644 --- a/.github/workflows/previews-cf.yml +++ b/.github/workflows/previews-cf.yml @@ -82,6 +82,7 @@ jobs: apiToken: ${{ secrets.CI_CF_PAGES }} accountId: ${{ secrets.CF_ACCOUNT_ID }} command: pages deploy dist --project-name=${{ env.PAGES_PROJECT_NAME }} --branch=${{ github.head_ref || github.ref_name }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} - name: Comment PR uses: thollander/actions-comment-pull-request@v3