-
Notifications
You must be signed in to change notification settings - Fork 335
58 lines (48 loc) · 1.69 KB
/
publish-docs.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
name: Publish Docs
on:
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
id-token: write
contents: write
jobs:
publish:
name: Publish Docs
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GIT_TOKEN }}
- uses: actions/setup-go@v1
with:
go-version: "1.19.4"
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
- name: Setup
run: make all
env:
NODE_OPTIONS: "--max-old-space-size=8192"
- name: Configure Shared Services AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ secrets.AWS_SHARED_SERVICES_IAM_ROLE }}
role-session-name: wave-shared
aws-region: ${{ secrets.AWS_WEST_REGION }}
- name: Publish Docs
run: |
make website
make publish-website
aws cloudfront create-invalidation --distribution-id $AWS_CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
env:
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
# Needs a sleep to wait for cloudfront cache bust.
- name: Reindex Algolia search
run: |
sleep 50s
curl -X POST -H "Content-Type: application/json" --user $ALGOLIA_CRAWLER_USER_ID:$ALGOLIA_CRAWLER_API_KEY https://crawler.algolia.com/api/1/crawlers/$ALGOLIA_CRAWLER_ID/reindex
env:
ALGOLIA_CRAWLER_API_KEY: ${{ secrets.ALGOLIA_CRAWLER_API_KEY }}
ALGOLIA_CRAWLER_ID: ${{ secrets.ALGOLIA_CRAWLER_ID }}
ALGOLIA_CRAWLER_USER_ID: ${{ secrets.ALGOLIA_CRAWLER_USER_ID }}