Skip to content

Instantly share code, notes, and snippets.

@nwesterhausen
Last active May 14, 2021 17:41
Show Gist options
  • Save nwesterhausen/d28d5a2e584c7d8bff5c30b7834e3264 to your computer and use it in GitHub Desktop.
Save nwesterhausen/d28d5a2e584c7d8bff5c30b7834e3264 to your computer and use it in GitHub Desktop.
Github Actions script that takes a mkdocs repository, renders it, and pushes to gh-pages. A "manual" way of doing what I found an existing action to do. All the plugins and mkdocs are in the Install Packages step, edit to match your needs.
name: Deploy
on:
push:
branches:
- main
jobs:
build:
name: Deploy docs to GitHub Pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v2
- name: Install Wheel Package
uses: BSFishy/pip-action@v1
with:
packages: wheel
- name: Install Packages
uses: BSFishy/pip-action@v1
with:
packages: |
mkdocs
pygments
mkdocs-material
mkdocs-safe-text-plugin
git+https://github.com/jldiaz/mkdocs-plugin-tags.git
mkdocs-markdownextradata-plugin
mkdocs-codeinclude-plugin
mkdocs-git-revision-date-localized-plugin
mkdocs-git-authors-plugin
mkdocs-blog-plugin
mkdocs-img2fig-plugin
mkdocs-mermaid2-plugin
mkdocs-awesome-pages-plugin
git+https://github.com/andyoakley/mkdocs-navtitles
mkdocs-redirects
mkdocs-minify-plugin
mkdocs-git-authors-plugin
- name: Build
run: mkdocs build
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment