-
Notifications
You must be signed in to change notification settings - Fork 7
66 lines (54 loc) · 1.94 KB
/
github-actions-copy-latest-docs-to-staging.yaml
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
---
name: Publish docs to staging website (/latest/)
on:
push:
branches: [dev]
# Allow running from the actions tab
workflow_dispatch:
permissions:
id-token: write
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out the schema repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Checkout Documentation
uses: actions/checkout@v4
with:
repository: OvertureMaps/docs
ref: main
path: docusaurus
- name: Copy Examples, Schema, & Docs
run: |
mkdir -p docusaurus/docs/_examples
cp -R examples/* docusaurus/docs/_examples/
mkdir -p docusaurus/docs/_schema
cp -R schema/* docusaurus/docs/_schema/
cp -R docs/schema docusaurus/docs/
- name: Build Docusaurus website
env:
DOCUSAURUS_URL: https://dfhx9f55j8eg5.cloudfront.net/
DOCUSAURUS_BASE_URL: /latest/
run: |
cd docusaurus
npm install --prefer-dedupe
npm run docusaurus build
- name: Fetch AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::207370808101:role/Overture_GitHub_schema_Publish_Docs_Staging
aws-region: us-east-2
- name: Copy Docusaurus website to staging bucket /latest/
run: |
aws --region us-east-2 s3 sync --delete --storage-class INTELLIGENT_TIERING docusaurus/build s3://overture-schema-docs-static-staging-us-east-2/latest
- name: Purge CDN cache
run: |
aws cloudfront create-invalidation --distribution-id E3L106P8HVBE9L --paths "/latest/*"
- name: Publish URL
run: echo "### [https://dfhx9f55j8eg5.cloudfront.net/latest/schema/](https://dfhx9f55j8eg5.cloudfront.net/latest/schema/)" >> $GITHUB_STEP_SUMMARY