GitHub settings

Github Actions setting for Mkdocs

Generate deploy key:

ssh-keygen -t rsa -b 4096 -C "your@email.com" -f mkdocs -N ""

Go to “Settings > Deploy Keys” of repository.

Add your public key within “Allow write access” option.

Go to “Settings > Secrets” of repository.

Add your private deploy key as ACTIONS_DEPLOY_KEY

Tutorial repo settings

Tutorial

Workflow syntax

Naming in Actions

name: github pages

on:
  push:
    paths: website/**

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1

    - name: Set up Python
      uses: actions/setup-python@v1
      with:
        python-version: '3.6'
        architecture: 'x64'

    - name: Install dependencies
      run: |
        python3 -m pip install --upgrade pip
        python3 -m pip install mkdocs
        python3 -m pip install MarkdownHighlight
        python3 -m pip install https://codeload.github.com/mkdocs/mkdocs-bootstrap/zip/master

    - name: Build
      run: |
        mkdocs build --config-file ./website/mkdocs.yml
        touch website/docs/.nojekyll

    - name: Deploy
      uses: peaceiris/actions-gh-pages@v2.5.1
      env:
        ACTIONS_DEPLOY_KEY: $
        PUBLISH_BRANCH: gh-pages
        PUBLISH_DIR: ./website/docs