Skip to content

Workflow file for this run

name: MkDocs Build + Deploy
on:
push:
branches:
- main # Set the branch you want to trigger the workflow on
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs mkdocs-material pymdown-extensions
- name: Build MkDocs
run: mkdocs build --clean
- name: Create and force push to documentation branch
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
git fetch --all
# Check if there are any local changes
if [ -n "$(git status --porcelain)" ]; then
# If there are changes, commit them
git add -A -f
git commit -m "Committing local changes before switching branches"
else
echo "No local changes to commit."
fi
git checkout production
# git add -A
# git commit -m 'prodtest'
# git push
ls ./
# Remove files and directories from the production branch
git rm -r --ignore-unmatch */*
git checkout main -- site
# git mv site docs
git add -A
git commit -m "Content update"
git push