-
-
Notifications
You must be signed in to change notification settings - Fork 31
100 lines (84 loc) · 2.85 KB
/
build-docs.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: build PyQGIS API docs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false
on:
schedule:
# runs once a week
- cron: '0 0 * * 0'
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-docs:
name: Build PyQGIS docs
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
qgis_version: [ 'master', 'stable', 'ltr' ]
outputs:
QGIS_VERSIONS_LIST: ${{ steps.version.outputs.QGIS_VERSIONS_LIST }}
steps:
- uses: actions/checkout@v4
- id: version
name: determine version
run: |
wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O yq && chmod +x yq
QGIS_CURRENT_LTR=$(yq .current_ltr pyqgis_conf.yml)
QGIS_CURRENT_STABLE=$(yq .current_stable pyqgis_conf.yml)
QGIS_VERSION=$(yq --exit-status .current_${{ matrix.qgis_version }} pyqgis_conf.yml) || QGIS_VERSION=$(echo "master")
vars=("QGIS_VERSION" "QGIS_CURRENT_STABLE" "QGIS_CURRENT_LTR")
for var in "${vars[@]}"; do
echo "${var}=${!var}"
echo "${var}=${!var}" >> "$GITHUB_OUTPUT"
echo "${var}=${!var}" >> "$GITHUB_ENV"
done
- name: Build PyQGIS docs
if: ${{ github.event_name != 'pull_request' || matrix.qgis_version == 'master' }}
run: |
./scripts/run-docker.sh -v ${QGIS_VERSION}
- uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' || matrix.qgis_version == 'master' }}
with:
name: ${{ matrix.qgis_version }}
path: ./build/
- name: Release
uses: softprops/action-gh-release@v2
if: ${{ github.event_name != 'pull_request' && matrix.qgis_version != 'master' }}
with:
tag_name: ${{ env.QGIS_VERSION }}
files: ./build/${{ env.QGIS_VERSION }}
deploy-docs:
if: ${{ github.event_name != 'pull_request' }}
name: Deploy to Github pages
runs-on: ubuntu-latest
needs: build-docs
steps:
- name: Get artifact for master
uses: actions/download-artifact@v4
with:
name: master
merge-multiple: true
- name: Get artifact for stable
if: ${{ github.event_name != 'pull_request' }}
uses: actions/download-artifact@v4
with:
name: stable
merge-multiple: true
- name: Get artifact for ltr
if: ${{ github.event_name != 'pull_request' }}
uses: actions/download-artifact@v4
with:
name: ltr
merge-multiple: true
- uses: actions/configure-pages@v5
- name: Deploy
uses: actions/upload-pages-artifact@v3
with:
path: .
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4