Skip to content

Commit

Permalink
Merge pull request #28 from futabooo/feat-deploy-cloudflare
Browse files Browse the repository at this point in the history
PlaywrightのテストレポートをCloudflare PagesにデプロイするGithubActionsを追加
  • Loading branch information
futabooo authored Dec 15, 2024
2 parents ad72303 + df63cc1 commit 6a5c1ea
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/playwright-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Expand All @@ -32,9 +33,20 @@ jobs:
- name: Run Playwright tests
run: npx playwright test

- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
- name: Deploy Playwright tests report
id: deploy
if: ${{ !cancelled() }}
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0
with:
name: playwright-report
path: playwright-report/
retention-days: 30
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy playwright-report --project-name=notion-bar-colorize

- name: Comment on PR with deployment URL
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
run: |
gh pr comment "${PR_NUMBER}" --edit-last \
--body "Playwright tests report deployed to ${DEPLOYMENT_URL}"

0 comments on commit 6a5c1ea

Please sign in to comment.