πŸ“š Home Lab Wiki Mirror to a Static Website Workflow

This page documents the process of mirroring the home lab Redmine wiki to GitHub as Markdown and converting it into a static HTML website available at https://homelab.refol.us.


1. Overview

This workflow automates the lifecycle of mirroring the lab wiki to a static website:

  1. Redmine Wiki: Original source of content.
  2. Ansible Playbook: Uses the redmine_wiki_mirror module to export pages as Markdown and commit to GitHub.
  3. GitHub Repository: Stores Markdown pages at https://github.com/t3knoid/homelab.
  4. GitHub Actions: Converts Markdown to static HTML.
  5. GitHub Pages: Hosts the static HTML site at https://homelab.refol.us.

Key Benefits:


2. Redmine Wiki to GitHub Markdown

Ansible Module: redmine_wiki_mirror

The redmine_wiki_mirror Ansible module is part of my personal refol.general Ansible collection. This module does the heavy-lifting of converting the Redmine wiki pages into markdown documents.

Example Usage

- hosts: localhost
  gather_facts: false
  tasks:
    - name: Mirror Redmine wiki into docs
      refol.general.redmine_wiki_mirror:
        redmine_url: "https://redmine.example.com"
        project: myproject
        api_key: "{{ lookup('env','REDMINE_API_KEY') }}"
        output_dir: "{{ playbook_dir }}/docs/redmine"
        delete_stale: true
        filename_extension: "md"
        debug: true
      register: redmine_mirror

    - name: Show mirror details
      debug:
        var: redmine_mirror

Notes:


3. GitHub Repository Structure

The mirrored Markdown files are stored flat in the root folder:

/README.md          # Repository documentation, protected
/index.md
/dc.md
/pihole.md
/playbooks.md
/roles.md
...

4. GitHub Actions: Markdown β†’ Static HTML

The repository includes a GitHub Actions workflow that:

  1. Watches for commits to the Markdown files.
  2. Converts Markdown to a static HTML site.
  3. Pushes the site to the gh-pages branch.
  4. Serves the website at https://homelab.refol.us.

Workflow highlights (from README):


5. Running the Wiki Sync

To mirror the Redmine wiki to GitHub:

  1. Set the inventory variable:
INV=inventory/redmine/inventory.ini
  1. Run the Ansible playbook:
ansible-playbook -k -i $INV playbooks/redmine/mirror_wiki.yml

Notes:

After the playbook completes, the GitHub Actions workflow will automatically convert the Markdown files to HTML and deploy the static site at https://homelab.refol.us.


6. Static Site Generation & Theme

All Markdown content in the root folder is processed by Jekyll during the GitHub Actions workflow to generate the static HTML site served at https://homelab.refol.us.


7. ASCII Diagram of the Workflow

   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  Redmine Wiki  β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Mirror
           β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ Ansible Playbook +            β”‚
   β”‚ redmine_wiki_mirror module    β”‚
   β”‚                               β”‚
   β”‚ - Fetch wiki pages            β”‚
   β”‚ - Convert to Markdown         β”‚
   β”‚ - Commit to GitHub            β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Push
           β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ GitHub Repository (homelab)   β”‚
   β”‚ Root folder contains Markdown β”‚
   β”‚ README.md is protected        β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Trigger
           β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ GitHub Actions Workflow       β”‚
   β”‚                               β”‚
   β”‚ - Converts Markdown β†’ HTML    β”‚
   β”‚ - Pushes HTML to gh-pages     β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
           β”‚ Serve
           β–Ό
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ GitHub Pages                  β”‚
   β”‚ https://homelab.refol.us      β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜