-
-
Notifications
You must be signed in to change notification settings - Fork 82
72 lines (58 loc) · 2.44 KB
/
gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# see https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/
name: Documentation
on:
release:
types: [ created, published ]
pull_request:
types:
- opened
- reopened
- synchronize
paths:
- 'mkdocs.yml'
- 'sootup.examples/**'
- 'docs/**'
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-tags: true
# to get tag information
- run: git fetch --prune --unshallow
- uses: actions/setup-python@v2
with:
python-version: 3.x
- name: install dependencies
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 \")
- run: git describe --tags `git rev-list --tags --max-count=1`
- run: git tag --sort=committerdate
- name: get latest release tag
id: "latestgittag"
run: latestgittagvar="$(git tag --sort=committerdate | grep -E '[0-9]' | tail -1 | cut -b 2-7)"
- run: echo "[${{steps.latestgittag.outputs.latestgittagvar}}]"
- name: replace "{{ git_latest_release }}" with latest release tag version in .md files
run: sed -i 's\{{ git_latest_release }}\'${{steps.latestgittag.outputs.latestgittagvar}}'\g' docs/**.md
- 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]"
- name: deploy doc in subdirectory (pr)
if: github.event_name == 'pull_request'
run: mike deploy ${{ github.head_ref }} --push
- name: deploy doc in subdirectory (release created)
if: github.event_name == 'release'
run: mike deploy ${{ github.ref_name }} --push
- name: set release as default (release published)
if: github.event_name == 'release' && github.event.action == 'published'
run: mike set-default --push ${{ github.ref_name }}