Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] Include deploy comment after merge #49951

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/deployNewHelp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- main
paths:
- 'help/**'
- './.github/workflows/deployNewHelp.yml'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just .github/workflows/deployNewHelp.yml -- why lead with ./?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed, NAB


# Run on any pull request (except PRs against staging or production) that has
# changes to the help directory. This will cause it to deploy this unmerged branch to
Expand All @@ -17,7 +18,7 @@ on:
branches-ignore: [staging, production]
paths:
- 'help/**'

- './.github/workflows/deployNewHelp.yml'
# Run on any manual trigger
workflow_dispatch:

Expand Down Expand Up @@ -69,14 +70,33 @@ jobs:
projectName: newhelp
directory: ./help/_site # Deploy the built site

# After deploying to Cloudflare, share wherever it deployed to in the PR comment.
# After deploying Cloudflare preview build, share wherever it deployed to in the PR comment.
- name: Leave a comment on the PR
uses: actions-cool/[email protected]
if: ${{ env.IS_PR_FROM_FORK != 'true' }}
if: ${{ github.event_name == 'pull_request' && env.IS_PR_FROM_FORK != 'true' }}
with:
token: ${{ github.token }}
body: ${{ format('Your New Help changes have been deployed to {0} :zap:️', steps.cloudflarePagesAction.outputs.alias) }}

- name: Get merged pull request
if: ${{ github.event_name == 'push' }}
id: getMergedPullRequest
uses: actions-ecosystem/action-get-merged-pull-request@59afe90821bb0b555082ce8ff1e36b03f91553d9
with:
github_token: ${{ github.token }}

- name: Leave a comment on the PR after it's merged
if: ${{ github.event_name == 'push' }}
run: |
gh pr comment ${{ steps.getMergedPullRequest.outputs.number }} --body "$(cat <<'EOF'
🚀Deployed to [NewHelp production](https://newhelp.expensify.com)! 🚀

([_View deploy workflow run_](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}))
EOF
)"
env:
GITHUB_TOKEN: ${{ github.token }}

# Use the Cloudflare CLI...
- name: Setup Cloudflare CLI
if: ${{ env.IS_PR_FROM_FORK != 'true' }}
Expand Down
4 changes: 3 additions & 1 deletion help/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ If you are a developer comfortable working on the command line, you can edit the
### The easy way: edit on Github
If you don't want to set up your own local dev environment, feel free to just edit the help materials directly from Github:

1. ... give instructions here ...
1. Open whatever file you want.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really just including this change so there would be a diff in help/, but it's a neat trick nonetheless

2. Replace `github.com` with `github.dev` in the URL
3. Edit away!

## How to add a page
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.
Expand Down
Loading