Skip to content

Deploy Example Site to GitHub Pages #11

Deploy Example Site to GitHub Pages

Deploy Example Site to GitHub Pages #11

name: Deploy Example Site to GitHub Pages
on:
workflow_dispatch:
inputs:
tag:
description: 'Docs tag to deploy'
required: true
type: string
default: main
mkdocs-terminal-version:
description: 'with mkdocs-terminal version'
required: false
type: string
environment-name:
description: 'Name of the environment to deploy'
required: true
type: choice
options:
- highlightjs
- highlightjs-dark
jobs:
deploy-example-site:
name: Deploy ${{ inputs.environment-name }}
environment: ${{ inputs.environment-name }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
- name: Install Explicitly Set mkdocs-terminal Version
run: |
if [[ "${{ inputs.mkdocs-terminal-version }}" == "" ]]; then
echo "no mkdocs-version override specified..."
else
pip install mkdocs-terminal==${{ inputs.mkdocs-terminal-version }}
fi
- name: Build MkDocs
run: |
cd tests/examples
make build site="${{ vars.EXAMPLE_NAME }}"
cd -
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.DEPLOY_KEY }}
external_repository: ${{ vars.GH_REPOSITORY_OWNER }}/${{ vars.GH_REPOSITORY_NAME }}
publish_dir: ./tests/examples/${{ vars.EXAMPLE_NAME }}/site