File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88permissions :
99 actions : read
1010 contents : read
11+ # Write sticky comment
12+ pull-requests : write
1113
1214env :
1315 CLOUDFLARE_PAGES_PROJECT_NAME : typelevel-website
@@ -36,11 +38,26 @@ jobs:
3638 github-token : ${{ secrets.GITHUB_TOKEN }}
3739 - name : Read PR number
3840 id : pr
39- run : echo "branch=pr-$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
41+ run : |
42+ echo "pr=$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
43+ echo "branch=pr-$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
44+
4045 - name : Deploy
4146 uses : cloudflare/wrangler-action@v4
47+ id : deploy
4248 with :
4349 apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
4450 accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
4551 gitHubToken : ${{ secrets.GITHUB_TOKEN }}
4652 command : pages deploy ./site --project-name=${{ env.CLOUDFLARE_PAGES_PROJECT_NAME }} --branch=${{ steps.pr.outputs.branch }}
53+ - name : Add branch preview info to PR
54+ uses : marocchino/sticky-pull-request-comment@v3
55+ with :
56+ number : ${{ steps.pr.outputs.pr }}
57+ header : preview
58+ message : |
59+ # Branch preview
60+
61+ A preview of the website generated with the content of this pull request is available at this URL:
62+
63+ ${{ steps.deploy.outputs.pages-deployment-alias-url }}
You can’t perform that action at this time.
0 commit comments