Skip to content
Closed
70 changes: 70 additions & 0 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy MkDocs

on:
pull_request:
workflow_dispatch:
workflow_call:
inputs:
repo:
type: string
required: true
branch_name:
type: string
required: true
default: "main"
secrets:
token:
required: true
user:
required: true
email:
required: true

env:
GH_TOKEN: ${{ secrets.token || secrets.YNPUT_BOT_TOKEN }}
GH_USER: ${{ secrets.user || secrets.CI_USER }}
GH_EMAIL: ${{ secrets.email || secrets.CI_EMAIL }}

jobs:
verify-repo-secrets:
uses: ynput/ops-repo-automation/.github/workflows/verify_secrets.yml@main
with:
repo: ${{ github.repository }}
secrets:
gh_token: ${{ secrets.token }}
gh_user: ${{ secrets.user }}
gh_email: ${{ secrets.email }}

deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout ${{ inputs.branch_name}}
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_name}}
fetch-depth: 0
submodules: true

- name: 🔑 Set Authentication
run: |
git config --global user.name "${{ secrets.user || secrets.CI_USER }}"
git config --global user.email "${{ secrets.email || secrets.CI_EMAIL }}"

- name: Get current tag
id: git_tag
uses: devops-actions/action-get-tag@v1.0.3
with:
default: 1.0.0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
python3 -m pip install -r ./docs/mkdocs_requirements.txt

- name: Mike deploy ${{ steps.git_tag.outputs.tag }}
run: mike deploy --update-aliases ${{ steps.git_tag.outputs.tag }} latest
9 changes: 9 additions & 0 deletions docs/mkdocs_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mkdocs-material >= 9.6.7
mkdocs-autoapi >= 0.4.0
mkdocstrings-python >= 1.16.2
mkdocs-minify-plugin >= 0.8.0
markdown-checklist >= 0.4.4
mdx-gh-links >= 0.4
pymdown-extensions >= 10.14.3
mike >= 2.1.3
mkdocstrings-shell >= 1.0.2
Loading