Skip to content

Publish schema documentation to staging website #919

Publish schema documentation to staging website

Publish schema documentation to staging website #919

---
name: Publish docs to staging website (for PR)
run-name: Publish schema documentation to staging website
on: [pull_request]
permissions:
id-token: write
contents: read
jobs:
publish:
environment:
name: staging
url: https://dfhx9f55j8eg5.cloudfront.net/pr/${{github.event.number}}/schema
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: /pr/${{github.event.number}}/
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 /pr/${{github.event.number}}/
run: |
aws --region us-east-2 s3 sync --delete --storage-class INTELLIGENT_TIERING docusaurus/build s3://overture-schema-docs-static-staging-us-east-2/pr/${{github.event.number}}
- name: Purge CDN cache
run: |
aws cloudfront create-invalidation --distribution-id E3L106P8HVBE9L --paths "/pr/${{github.event.number}}/*"
- name: Publish URL
run: echo "View preview page at [https://dfhx9f55j8eg5.cloudfront.net/pr/${{github.event.number}}/](https://dfhx9f55j8eg5.cloudfront.net/pr/${{github.event.number}}/schema)" >> $GITHUB_STEP_SUMMARY