Deploy a MkDocs site to GitHub Pages via GitHub Actions

The following GitHub Action workflow to build and deploy the site to GitHub Pages gh-pages branch:

name: Publish
on:
  push:
    branches: [ "main" ]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python 3.10
      uses: actions/setup-python@v3
      with:
        python-version: "3.10"
    - name: ⚙️ Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install mkdocs
    - name: 🏗️ Build Site
      run: mkdocs build
    - name: 🚀 Deploy
      uses: JamesIves/github-pages-deploy-action@v4
      with:
        folder: site

Tags: #github-actions #mkdocs #github-pages