Skip to content

Commit

Permalink
enable multiple versions of doc
Browse files Browse the repository at this point in the history
  • Loading branch information
swissiety committed Oct 31, 2023
1 parent c4d41dc commit 85563f8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/gh-pages-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Delete obsolete Documentation
on: delete

permissions:
contents: write

jobs:
delete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mike
- run: git fetch origin gh-pages --depth=1
- name: Configure git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- run: mike delete $(echo ${{ github.event.ref }} | sed -e "s#refs/heads/##g") --push
15 changes: 11 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Documentation
on:
push:
branches:
- develop
# only trigger workflow if one of these paths are affected as well
paths:
- 'mkdocs.yml'
- 'sootup.examples/**'
- 'docs/**'

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -17,12 +17,19 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mike
- run: pip install mkdocs-material
- run: pip install mkdocs-tooltips
- run: pip install git+https://github.com/RedisLabs/mkdocs-include.git
- run: pip install git+https://github.com/swissiety/LspLexer4Pygments.git
# grab latest release url of the JimpleLSP jar and download it
- run: curl -s -L -o ./jimplelsp.jar $(curl -s https://api.github.com/repos/swissiety/jimpleLsp/releases/latest | grep 'browser_download_url".*jar"' | cut -d ':' -f 2,3 | tr -d \")
# replace version in .md files

- run: sed -i 's\{{ git_latest_release }}\'$(git tag --sort=committerdate | grep -E '[0-9]' | tail -1 | cut -b 2-7)'\g' *.md
- run: mkdocs gh-deploy --force
- run: git fetch origin gh-pages --depth=1
- name: Configure git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- run: mike deploy ${{ github.ref_name }} --push

0 comments on commit 85563f8

Please sign in to comment.