Skip to content

Deploy Docs

Deploy Docs #124

Workflow file for this run

name: Deploy Docs
on:
workflow_dispatch:
workflow_run:
workflows: [ "Release Workflow" ]
types: [ completed ]
push:
branches:
- main
- latest
permissions:
contents: write
jobs:
build:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install mkdocs
env:
MKDOCSMAT_TOKEN: ${{ secrets.MKDOCSMAT_TOKEN }}
run: |
pip install \
mkdocs \
mike \
md-toc \
git+https://${MKDOCSMAT_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
- name: Generate service config docs
run: bash generate-service-config-docs.sh
- name: Update env for docs (dev/main)
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "DOCS_EDIT_URI=/edit/main/docs/" >> $GITHUB_ENV
echo "DOCS_VERSION=dev" >> $GITHUB_ENV
- name: Update env for docs (latest)
if: ${{ github.ref == 'refs/heads/latest' }}
run: |
echo "DOCS_EDIT_URI=/edit/latest/docs/" >> $GITHUB_ENV
echo "DOCS_VERSION=latest" >> $GITHUB_ENV
- name: Setup Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
- name: Deploy docs
run: mike deploy --push $DOCS_VERSION