Merge pull request #9 from timothyhull/timothyhull/Add-indexmd
-content
#4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Build Documentation with MkDocs | |
## https://squidfunk.github.io/mkdocs-material/publishing-your-site/?h=github+actions#with-github-actions | |
name: Build Documentation With MkDocs | |
# Set the GitHub event triggers | |
on: | |
# Trigger the workflow on push events for the main branch | |
push: | |
branches: | |
- main | |
# Allow manual run of the Action | |
workflow_dispatch: | |
# Set workflow permissions | |
permissions: | |
contents: write | |
# Set environment variables | |
env: | |
cache_id: # Placeholder for value set in the Set cache_id Environment Variable step | |
CONFIG_FILE: mkdocs.insiders.yml | |
GIT_PREFIX: 'git+https://' | |
GIT_SUFFIX: '@github.com/timothyhull/mkdocs-material-insiders.git' | |
MKDOCS_TOKEN: ${{ secrets.MKDOCS_TOKEN }} | |
jobs: | |
build: | |
name: Build and Deploy | |
runs-on: ubuntu-latest | |
if: github.event.repository.fork == false | |
steps: | |
# checkout@ action documentation | |
# https://github.com/marketplace/actions/checkout | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
# Configure Git credentials | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
# setup-python@ action documentation | |
# https://github.com/marketplace/actions/setup-python | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
# Set cache_id environment variable | |
- name: Set cache_id Environment Variable | |
run: | | |
echo "cache_id=$(date --utc '+%V')" >> "$GITHUB_ENV" | |
# cache@ action documentation | |
# https://github.com/actions/cach | |
- name: Setup Build Cache | |
uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
# Install Material for MkDocs Insiders | |
- name: Install Material for MkDocs Insiders | |
run: | | |
python -m pip install \ | |
${{ env.GIT_PREFIX }}${{ env.MKDOCS_TOKEN }}${{ env.GIT_SUFFIX }} | |
# Deploy Material for MkDocs to GitHub Pages | |
- name: Deploy GitHub Pages | |
run: | | |
mkdocs gh-deploy --config-file ${{ env.CONFIG_FILE }} --force |