Github Actions for Documentation

sodrooome

Ryan Febriansyah

Posted on September 6, 2020

Github Actions for Documentation

My Workflow

it was my first time using github actions to deploy my project documentation automatically. Previously, deployment for documentation itself was done "conventionally" and the exists of github actions is arguably very helpful for me. For the example itself, it will be deploying for Mkdocs site to github pages.

Submission Category

DIY Deployments

Yaml File or Link to Code

This is what my configuration looks like

name: Build
on:
  push:
    branches: master

jobs:
  build:
    name: Deploy docs
    runs-on: ubuntu-latest
    steps:
      - name: Checkout master
        uses: actions/checkout@v1

      - name: Deploy docs
        uses: mhausenblas/mkdocs-deploy-gh-pages@1.11
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The configuration itself it's pretty simple, but there are two ways for generating and building your documentation into github pages. The first way is to use a PERSONAL_TOKEN that we can create a secret key in the our repository, and the second way is to use GITHUB_TOKEN that automatically generated by github actions when a workflow runs so it's pretty convenient.

However, it's highly recommended to use a PERSONAL_TOKEN because it's safer rather than use GITHUB_TOKEN.

Additional Resources / Info

This is the link for my github actions repository :

https://github.com/sodrooome/pure-datastructures

Please let me know if you have any feedback or if you want me to add new features! Thank you!

💖 💪 🙅 🚩
sodrooome
Ryan Febriansyah

Posted on September 6, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Label automation at your fingertips
actionshackathon21 Label automation at your fingertips

December 8, 2021

Releasing the funniest GitHub Action & Workflow
actionshackathon21 Releasing the funniest GitHub Action & Workflow

December 9, 2021

IoT Commit : IoT Github Action
actionshackathon21 IoT Commit : IoT Github Action

December 8, 2021