From 1c2104d073b636cf07ee4ffdcd1a65686fa0b316 Mon Sep 17 00:00:00 2001 From: Ryo Takeuchi Date: Sat, 20 Jul 2024 17:14:38 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20cloudflare/wrangler-action=20=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 3 ++- .github/workflows/preview.yml | 1 + .github/workflows/production.yml | 1 + .github/workflows/wc-deploy-cloudflare-pages.yml | 12 ++++++------ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3fdab55..9d6193a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -13,7 +13,8 @@ jobs: deploy: uses: ./.github/workflows/wc-deploy-cloudflare-pages.yml with: - branch: 'develop' + project-name: 'nito-docs' + branch: 'staging' gh-app-id: ${{ vars.BOT_APP_ID }} pr-comment-enabled: false secrets: diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index f1acff6..0483f45 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -18,6 +18,7 @@ jobs: needs: changed if: needs.changed.outputs.docs == 'true' with: + project-name: 'nito-docs' branch: 'preview' gh-app-id: ${{ vars.BOT_APP_ID }} pr-comment-enabled: true diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index 8922053..5f0a1f2 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -14,6 +14,7 @@ jobs: deploy: uses: ./.github/workflows/wc-deploy-cloudflare-pages.yml with: + project-name: 'nito-docs' branch: 'main' gh-app-id: ${{ vars.BOT_APP_ID }} pr-comment-enabled: false diff --git a/.github/workflows/wc-deploy-cloudflare-pages.yml b/.github/workflows/wc-deploy-cloudflare-pages.yml index f83882f..c7a0e5b 100644 --- a/.github/workflows/wc-deploy-cloudflare-pages.yml +++ b/.github/workflows/wc-deploy-cloudflare-pages.yml @@ -3,6 +3,9 @@ name: "Deploy Cloudflare Pages" on: workflow_call: inputs: + project-name: + required: true + type: string branch: required: true type: string @@ -53,15 +56,12 @@ jobs: # https://github.com/marketplace/actions/cloudflare-pages-github-action - name: Publish to Cloudflare Pages - uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1.5.0 + uses: cloudflare/wrangler-action@f84a562284fc78278ff9052435d9526f9c718361 # v3.7.0 id: cloudflare-pages with: apiToken: ${{ secrets.cloudflare-api-token }} accountId: ${{ secrets.cloudflare-account-id }} - projectName: nito-docs - directory: ./dist - gitHubToken: ${{ steps.app-token.outputs.token }} - branch: ${{ inputs.branch }} + command: pages deploy ./dist --project-name=${{ inputs.project-name }} --branch=${{ inputs.branch }} # https://github.com/marketplace/actions/lighthouse-check - name: Lighthouse @@ -70,4 +70,4 @@ jobs: gitHubAccessToken: ${{ steps.app-token.outputs.token }} locale: ja prCommentEnabled: ${{ inputs.pr-comment-enabled }} - urls: ${{ steps.cloudflare-pages.outputs.url }} + urls: ${{ steps.cloudflare-pages.outputs.deployment-url }}