Skip to content

SOF-7907: doc on contributing new application (#363) #97

SOF-7907: doc on contributing new application (#363)

SOF-7907: doc on contributing new application (#363) #97

Workflow file for this run

name: Update S3 deploy
on:
push:
branches:
- "main"
- "dev"
schedule:
- cron: "0 0 1 1 *"
workflow_dispatch:
jobs:
build:
name: Deploy docs
runs-on: ubuntu-24.04
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
lfs: true
submodules: true
- name: Set python 3 version
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.10"
- name: Build pages (legacy)
uses: Exabyte-io/action-mkdocs-build@main
- name: Build split sites
run: |
python -m mkdocs build -f mkdocs-guide.yml -d site/guide
python -m mkdocs build -f mkdocs-interface.yml -d site/interface
python -m mkdocs build -f mkdocs-concepts.yml -d site/reference
python -m mkdocs build -f mkdocs-resources.yml -d site/resources
python -m mkdocs build -f mkdocs-developers.yml -d site/developers
python -m mkdocs build -f mkdocs-cli.yml -d site/command-line
python -m mkdocs build -f mkdocs-standards.yml -d site/standards
# Fix and copy subsite homepages to root of each subsite
fix_homepage() {
local src="$1"
local dst="$2"
if [ -f "$src" ]; then
sed \
-e 's|"base": ".."|"base": "."|' \
-e 's|"\.\./assets/|"./assets/|g' \
-e 's|"\.\./search/|"./search/|g' \
-e 's|"\.\./extra/|"./extra/|g' \
-e 's|"\.\./images/|"./images/|g' \
-e 's|href="\.\./|href="./|g' \
-e 's|src="\.\./|src="./|g' \
"$src" > "$dst"
fi
}
fix_homepage site/guide/index-guide/index.html site/guide/index.html
fix_homepage site/interface/index-interface/index.html site/interface/index.html
fix_homepage site/reference/index-concepts/index.html site/reference/index.html
fix_homepage site/resources/index-resources/index.html site/resources/index.html
fix_homepage site/developers/index-developers/index.html site/developers/index.html
fix_homepage site/command-line/index-cli/index.html site/command-line/index.html
fix_homepage site/standards/index-standards/index.html site/standards/index.html
- name: Deploy to Production (dev branch, old docs)
if: github.ref == 'refs/heads/dev'
uses: Reggionick/s3-deploy@04c48f45adfd7a34c66348cf9cd1b6cd117cc467 # v4.0.0
with:
folder: site
bucket: docs.mat3ra.com
bucket-region: ${{ secrets.S3_LOCATION }}
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
invalidation: /*
no-cache: true
private: true
- name: Deploy to Development (main branch, new docs)
if: github.ref == 'refs/heads/main'
uses: Reggionick/s3-deploy@04c48f45adfd7a34c66348cf9cd1b6cd117cc467 # v4.0.0
with:
folder: site
bucket: docs-new.mat3ra.com
bucket-region: ${{ secrets.S3_LOCATION_1 }}
dist-id: ${{ secrets.CLOUDFRONT_DEV_DISTRIBUTION_ID_1 }}
invalidation: /*
no-cache: true
private: true