-
Notifications
You must be signed in to change notification settings - Fork 2.9k
73 lines (60 loc) · 2.37 KB
/
deployExpensifyHelp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Deploy ExpensifyHelp
on:
# Run on any push to main that has changes to the docs directory
push:
branches:
- main
paths:
- 'docs/**'
# Run on any pull request (except PRs against staging or production) that has changes to the docs directory
pull_request:
types: [opened, synchronize]
branches-ignore: [staging, production]
paths:
- 'docs/**'
# Run on any manual trigger
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup NodeJS
uses: ./.github/actions/composite/setupNode
- name: Create docs routes file
run: ./.github/scripts/createDocsRoutes.sh
- name: Build with Jekyll
uses: actions/jekyll-build-pages@0143c158f4fa0c5dcd99499a5d00859d79f70b0e
with:
source: ./docs/
destination: ./docs/_site
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca
id: deploy
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: helpdot
directory: ./docs/_site
- name: Setup Cloudflare CLI
run: pip3 install cloudflare==2.19.0
- name: Purge Cloudflare cache
run: /home/runner/.local/bin/cli4 --verbose --delete hosts=["help.expensify.com"] /zones/:9ee042e6cfc7fd45e74aa7d2f78d617b/purge_cache
env:
CF_API_KEY: ${{ secrets.CLOUDFLARE_TOKEN }}
- name: Leave a comment on the PR
uses: actions-cool/maintain-one-comment@de04bd2a3750d86b324829a3ff34d47e48e16f4b
if: ${{ github.event_name == 'pull_request' }}
with:
token: ${{ secrets.OS_BOTIFY_TOKEN }}
body: ${{ format('A preview of your ExpensifyHelp changes have been deployed to {0} ⚡️', steps.deploy.outputs.alias) }}
- name: Reindex google search
if: ${{ github.event_name == 'push' }}
run : |
curl "https://www.google.com/ping?sitemap=https://help.expensify.com/sitemap.xml"