From 5028f1c32a500257df478e6374f53450d2520a35 Mon Sep 17 00:00:00 2001 From: Pavlo Golub Date: Mon, 16 Dec 2024 13:43:43 +0100 Subject: [PATCH] [+] add docs versioning --- .github/workflows/build.yml | 37 ++++++++++++++++++++++++++++++++++++- docs/_overrides/main.html | 8 ++++++++ mkdocs.yml | 6 +++++- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 docs/_overrides/main.html diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a612a5cb7..1aef19072 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,8 +122,10 @@ jobs: name: Build Docker Image runs-on: ubuntu-latest steps: + - name: Check out code uses: actions/checkout@v4 + - name: Build Docker Image shell: bash run: | @@ -132,4 +134,37 @@ jobs: --build-arg GIT_HASH=`git show -s --format=%H HEAD` \ --build-arg VERSION=`git rev-parse --abbrev-ref HEAD` \ -t cybertecpostgresql/pgwatch:latest \ - -f docker/Dockerfile . \ No newline at end of file + -f docker/Dockerfile . + + build-docs: + if: true # false to skip job during debug + needs: build + name: Build Docs + runs-on: ubuntu-latest + steps: + + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Golang + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Set up gopages + run: go install github.com/johnstarich/go/gopages@v0.1.28 + + - name: Build Developer Docs + run: gopages -out "docs/godoc" -base "/godoc" -internal + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + cache: 'pip' + + - name: Install dependencies + run: pip install mkdocs-material mkdocs-glightbox + + - name: Build mkdocs + run: mkdocs build diff --git a/docs/_overrides/main.html b/docs/_overrides/main.html new file mode 100644 index 000000000..f3bc76378 --- /dev/null +++ b/docs/_overrides/main.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} + +{% block outdated %} +You're not viewing the latest version. + + Click here to go to latest. + +{% endblock %} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 2206f0751..1b313cd55 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -89,4 +89,8 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences - - attr_list \ No newline at end of file + - attr_list + +extra: + version: + provider: mike \ No newline at end of file