|
8 | 8 | - main
|
9 | 9 | paths:
|
10 | 10 | - 'help/**'
|
| 11 | + - './.github/workflows/deployNewHelp.yml' |
11 | 12 |
|
12 | 13 | # Run on any pull request (except PRs against staging or production) that has
|
13 | 14 | # changes to the help directory. This will cause it to deploy this unmerged branch to
|
|
17 | 18 | branches-ignore: [staging, production]
|
18 | 19 | paths:
|
19 | 20 | - 'help/**'
|
20 |
| - |
| 21 | + - './.github/workflows/deployNewHelp.yml' |
21 | 22 | # Run on any manual trigger
|
22 | 23 | workflow_dispatch:
|
23 | 24 |
|
@@ -69,14 +70,33 @@ jobs:
|
69 | 70 | projectName: newhelp
|
70 | 71 | directory: ./help/_site # Deploy the built site
|
71 | 72 |
|
72 |
| - # After deploying to Cloudflare, share wherever it deployed to in the PR comment. |
| 73 | + # After deploying Cloudflare preview build, share wherever it deployed to in the PR comment. |
73 | 74 | - name: Leave a comment on the PR
|
74 | 75 | uses: actions-cool/maintain-one-comment@v3.2.0
|
75 |
| - if: ${{ env.IS_PR_FROM_FORK != 'true' }} |
| 76 | + if: ${{ github.event_name == 'pull_request' && env.IS_PR_FROM_FORK != 'true' }} |
76 | 77 | with:
|
77 | 78 | token: ${{ github.token }}
|
78 | 79 | body: ${{ format('Your New Help changes have been deployed to {0} :zap:️', steps.cloudflarePagesAction.outputs.alias) }}
|
79 | 80 |
|
| 81 | + - name: Get merged pull request |
| 82 | + if: ${{ github.event_name == 'push' }} |
| 83 | + id: getMergedPullRequest |
| 84 | + uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9 |
| 85 | + with: |
| 86 | + github_token: ${{ github.token }} |
| 87 | + |
| 88 | + - name: Leave a comment on the PR after it's merged |
| 89 | + if: ${{ github.event_name == 'push' }} |
| 90 | + run: | |
| 91 | + gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} --body "$(cat <<'EOF' |
| 92 | + 🚀Deployed to [NewHelp production](https://newhelp.expensify.com)! 🚀 |
| 93 | +
|
| 94 | + ([_View deploy workflow run_](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})) |
| 95 | + EOF |
| 96 | + )" |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ github.token }} |
| 99 | + |
80 | 100 | # Use the Cloudflare CLI...
|
81 | 101 | - name: Setup Cloudflare CLI
|
82 | 102 | if: ${{ env.IS_PR_FROM_FORK != 'true' }}
|
|
0 commit comments