Skip to content

MkDocs Build and Deploy #13

MkDocs Build and Deploy

MkDocs Build and Deploy #13

name: MkDocs Build and Deploy
on:
workflow_dispatch:
# push:
# branches: main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: site
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material
- name: Build static files
run: mkdocs build
- name: Building gh-pages repo
working-directory: site
run: |
git init -b gh-pages
git config --global user.email "actions@github.com"
git config --global user.name "github-actions"
git add -A
git commit -m "Update static files"
- name: Pushing static files
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: site
force: true