From 140e1dd4f94d57709b8d566efde01f534b2ae882 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Wed, 30 Aug 2023 12:32:19 +0200 Subject: [PATCH 1/3] Version website with mike --- .docs-theme/main.html | 6 ++++ .docs-theme/overrides/home.html | 2 +- .github/workflows/docs.yml | 52 ++++++++------------------------- mkdocs.yml | 4 ++- requirements.txt | 1 + 5 files changed, 23 insertions(+), 42 deletions(-) diff --git a/.docs-theme/main.html b/.docs-theme/main.html index 47e114897..f7d90c785 100644 --- a/.docs-theme/main.html +++ b/.docs-theme/main.html @@ -45,4 +45,10 @@ {% block herocontent %}{% endblock %}
+{% endblock %} +{% 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/.docs-theme/overrides/home.html b/.docs-theme/overrides/home.html index d3bf72c1c..6c0936539 100644 --- a/.docs-theme/overrides/home.html +++ b/.docs-theme/overrides/home.html @@ -20,7 +20,7 @@

Launch containers
on demand

- +
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7686427da..e3ca3fc17 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,8 +6,6 @@ on: pull_request: branches-ignore: - 'gh-pages' - schedule: - - cron: '0 * * * *' jobs: build: name: Build @@ -24,44 +22,18 @@ jobs: architecture: x64 - name: Install requirements.txt run: pip install -r requirements.txt - - name: Build - run: mkdocs build - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: site - path: site/* - if-no-files-found: error - deploy: - name: Deploy - runs-on: ubuntu-latest - needs: - - build - if: github.ref == 'refs/heads/main' - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - ref: gh-pages - path: dist - - name: Download artifacts - uses: actions/download-artifact@v2 - with: - name: site - path: artifacts - - name: Deploy + - name: Setup git run: | - set -euo pipefail - rsync -az --exclude=.git --delete ./artifacts/ ./dist/ - cd dist - git config user.name "ContainerSSH Build Agent" - git config user.email 86986082+containersshbuilder@users.noreply.github.com - git add . - if ! git diff-index --quiet HEAD --; then - git commit -m "Website publish" - git push --set-upstream --force origin gh-pages - fi + git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" + git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" + git fetch origin gh-pages + - name: Deploy upcoming + run: mike deploy upcoming --push + if: github.ref == 'refs/heads/main' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Deploy version + run: mike deploy "$GITHUB_REF_NAME" --push + if: startsWith(github.ref, 'refs/heads/v') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 4845b161e..e5a387b61 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,6 +38,8 @@ theme: include_search_page: false search_index_only: 'false' extra: + version: + provider: mike social: - icon: fontawesome/brands/github link: https://github.com/ContainerSSH @@ -278,6 +280,6 @@ copyright: > | Brand assets | Privacy Policy | Imprint

- Cloud Native Computing Foundation
+ Cloud Native Computing Foundation
We are a Cloud Native Computing Foundation sandbox project.

The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see Trademark Usage. Docker and the Docker logo are trademarks of Docker, Inc. diff --git a/requirements.txt b/requirements.txt index 30bfd3792..1af5ff0db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ PyGithub~=1.54 pyyaml>=5.3.1 requests mkdocs-rss-plugin +mike From d271852a7e8086ed3343d5a1e1944a5fe9365eea Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sun, 3 Sep 2023 19:56:10 +0200 Subject: [PATCH 2/3] Fix build with latest mkdocs --- mkdocs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index e5a387b61..6abdbaea1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -228,8 +228,6 @@ nav: plugins: - search - macros - - blog: - format: "" - redirects: redirect_maps: 'security.md': 'about/security.md' From ef84c8471556fad0d2df4a92371d6c489a239027 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Sun, 3 Sep 2023 20:20:21 +0200 Subject: [PATCH 3/3] Fix blog link with mike --- .docs-theme/main.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docs-theme/main.html b/.docs-theme/main.html index f7d90c785..e5a8d72dc 100644 --- a/.docs-theme/main.html +++ b/.docs-theme/main.html @@ -35,7 +35,7 @@ {% endblock %} {% block announce %} - + ContainerSSH 0.4.1: Bugfixing Audit & Proxy is now available! Read more » {% endblock %}