Skip to content

Commit b541131

Browse files
authored
Merge pull request #49951 from Expensify/Rory-HelpDotProdDeployComment
[No QA] Include deploy comment after merge
2 parents 01c4d42 + 5f9a9e3 commit b541131

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

.github/workflows/deployNewHelp.yml

+23-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- main
99
paths:
1010
- 'help/**'
11+
- './.github/workflows/deployNewHelp.yml'
1112

1213
# Run on any pull request (except PRs against staging or production) that has
1314
# changes to the help directory. This will cause it to deploy this unmerged branch to
@@ -17,7 +18,7 @@ on:
1718
branches-ignore: [staging, production]
1819
paths:
1920
- 'help/**'
20-
21+
- './.github/workflows/deployNewHelp.yml'
2122
# Run on any manual trigger
2223
workflow_dispatch:
2324

@@ -69,14 +70,33 @@ jobs:
6970
projectName: newhelp
7071
directory: ./help/_site # Deploy the built site
7172

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.
7374
- name: Leave a comment on the PR
7475
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' }}
7677
with:
7778
token: ${{ github.token }}
7879
body: ${{ format('Your New Help changes have been deployed to {0} :zap:️', steps.cloudflarePagesAction.outputs.alias) }}
7980

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+
80100
# Use the Cloudflare CLI...
81101
- name: Setup Cloudflare CLI
82102
if: ${{ env.IS_PR_FROM_FORK != 'true' }}

help/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ If you are a developer comfortable working on the command line, you can edit the
2828
### The easy way: edit on Github
2929
If you don't want to set up your own local dev environment, feel free to just edit the help materials directly from Github:
3030

31-
1. ... give instructions here ...
31+
1. Open whatever file you want.
32+
2. Replace `github.com` with `github.dev` in the URL
33+
3. Edit away!
3234

3335
## How to add a page
3436
The current design of NewHelp.expensify.com is only to have a very small handful pages (one for each "product"), each of which is a markdown file stored in `/help` using the `product` template (defined in `/help/_layouts/product.html`). Accordingly, it's very unlikely you'll be adding a new page.

0 commit comments

Comments
 (0)