forked from mapproxy/mapproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.43 KB
/
ghpages.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
name: Build and deploy documentation on github pages
on:
push:
tags:
- "*.*.*"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: upgrade-docs
- name: Install dependencies ⏬
run: pip install sphinx sphinx-book-theme sphinx-copybutton
- name: Run documentation build
run: sphinx-build doc/ docs -D html_context.current_version=${{ github.ref_name }}
- name: Deploy docs to folder `latest` to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: docs
target-folder: docs/latest
- name: Deploy docs to a folder named after the new tag to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: docs
target-folder: docs/${{ github.ref_name }}
- name: Update versions config
# read existing versions from gh-pages branch, add new version, sort, dedupe and write results to config/versions.json
run: |
mkdir config
echo -e "${{ github.ref_name }}\n$(git show gh-pages:config/versions.json | jq -r '.[]')" \
| sort -V | uniq | jq -R -s -c 'split("\n")[:-1]' > config/versions.json
- name: Deploy config folder to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: config
target-folder: docs/config