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+ deployments : write
12+ # Write sticky comment
13+ pull-requests : write
1114
1215env :
1316 CLOUDFLARE_PAGES_PROJECT_NAME : typelevel-website
@@ -36,11 +39,28 @@ jobs:
3639 github-token : ${{ secrets.GITHUB_TOKEN }}
3740 - name : Read PR number
3841 id : pr
39- run : echo "branch=pr-$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
42+ run : |
43+ echo "pr=$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
44+ echo "branch=pr-$(cat pr_number.txt)" >> "$GITHUB_OUTPUT"
45+
4046 - name : Deploy
4147 uses : cloudflare/wrangler-action@v4
48+ id : deploy
4249 with :
4350 apiToken : ${{ secrets.CLOUDFLARE_API_TOKEN }}
4451 accountId : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
4552 gitHubToken : ${{ secrets.GITHUB_TOKEN }}
4653 command : pages deploy ./site --project-name=${{ env.CLOUDFLARE_PAGES_PROJECT_NAME }} --branch=${{ steps.pr.outputs.branch }}
54+ - name : Add branch preview info to PR
55+ uses : marocchino/sticky-pull-request-comment@v3
56+ with :
57+ number : ${{ steps.pr.outputs.pr }}
58+ header : preview
59+ message : |
60+ # Branch preview
61+
62+ A preview of the website has been generated with the content of this pull request.
63+
64+ | Name | Result |
65+ | ----------------------- | ------ |
66+ | **Branch Preview URL**: | ${{ steps.deploy.outputs.pages-deployment-alias-url }} |
You can’t perform that action at this time.
0 commit comments