Skip to content

Commit

Permalink
Merge pull request #182 from nitoclub/improve/GH-181
Browse files Browse the repository at this point in the history
ci: cloudflare/wrangler-action に変更
  • Loading branch information
tatsutakein authored Jul 20, 2024
2 parents 7ad9d77 + 1c2104d commit 0b2790f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/wc-deploy-cloudflare-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: "Deploy Cloudflare Pages"
on:
workflow_call:
inputs:
project-name:
required: true
type: string
branch:
required: true
type: string
Expand Down Expand Up @@ -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
Expand All @@ -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 }}

0 comments on commit 0b2790f

Please sign in to comment.