Skip to content

Commit

Permalink
Merge pull request #1109 from product-os/vipulgupta2048/link-cf-pr
Browse files Browse the repository at this point in the history
Add Cloudflare Pages link as PR comment
  • Loading branch information
flowzone-app[bot] authored Jul 13, 2024
2 parents ebf07e0 + cb93021 commit 7d51a5a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/flowzone.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 19 additions & 2 deletions flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3286,13 +3286,30 @@ jobs:
echo "CF_BRANCH=${{ github.event.repository.default_branch }}" >> "${GITHUB_ENV}"
- name: Deploy to Cloudflare Pages
id: deploy_cf_pages
uses: cloudflare/wrangler-action@f84a562284fc78278ff9052435d9526f9c718361 # v3.7.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
wranglerVersion: "3.5.1" # latest - https://www.npmjs.com/package/wrangler
command: --version
postCommands: npx wrangler pages deploy --branch ${{ env.CF_BRANCH }} --project-name=${{ inputs.cloudflare_website }} build/ | tee -a $GITHUB_STEP_SUMMARY
command: pages deploy --branch ${{ env.CF_BRANCH }} --project-name=${{ inputs.cloudflare_website }} build/

- name: Find Cloudflare Pages link comment
uses: peter-evans/[email protected]
id: find_cf_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Website deployed to CF Pages, 👀 preview link

- name: Create or update Cloudflare Pages link comment if deployment link present
uses: peter-evans/[email protected]
if: steps.deploy_cf_pages.outputs.deployment-url != ''
with:
comment-id: ${{ steps.find_cf_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
Website deployed to CF Pages, 👀 preview link ${{ steps.deploy_cf_pages.outputs.deployment-url }}
###################################################
# GitHub
Expand Down

0 comments on commit 7d51a5a

Please sign in to comment.