Skip to content

build_docs_triggered_by_catapult #158

build_docs_triggered_by_catapult

build_docs_triggered_by_catapult #158

Workflow file for this run

name: Deploy Docs to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows triggering this workflow from another repository
repository_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
# 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
# Default to bash
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
repository: ClarifiedSecurity/catapult
path: catapult
token: ${{ secrets.TOKEN_CATAPULT_DOCS }}
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
repository: ClarifiedSecurity/catapult-customizer
path: catapult-customizer
token: ${{ secrets.TOKEN_CATAPULT_DOCS }}
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
repository: ClarifiedSecurity/nova.core
path: nova-core
token: ${{ secrets.TOKEN_CATAPULT_DOCS }}
- run: rsync -avm --delete --include='*/' --include='*.md' --exclude='*' catapult/docs/ docs/catapult/
- run: rsync -avm --delete --include='*/' --include='*.md' --exclude='*' catapult-customizer/ docs/catapult-customizer/
- run: rsync -avm --delete --include='*/' --include='*.md' --exclude='*' nova-core/nova/core/roles/ docs/nova-core-collection/
- run:
find docs/nova-core-collection/ -type f -iname "*.md" -exec sh -c 'dir=$(dirname "$1");
parent=$(dirname "$dir"); base=$(basename "$dir"); mv "$1" "$parent/$base.md" ' sh {} \;
- run: find docs/nova-core-collection/ -type d -depth -empty -exec rmdir {} \;
- run: rm -rf catapult catapult-customizer nova-core
- run: find docs/nova-core-collection/ -type f -exec
sed -i 's|https://github.com/novateams/nova.core|https://github.com/ClarifiedSecurity/nova.core|g' {} \;
- run: |
git config --global user.name "CatapultBot"
git config --global user.email "catapult@clarifiedsecurity.com"
git add docs
git status
git diff --quiet && git diff --staged --quiet || git commit -m "CatapultBot update docs"
git push -o ci.skip
git status
docs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
- run: git fetch --all --depth=1 && git pull --all --rebase --depth=1
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force