Skip to content

Commit 2791943

Browse files
docs: publish docs too zoomin
Add pipeline to publidh docs to zoomin. Signed-off-by: Giacomo Dematteis <[email protected]>
1 parent 253cb16 commit 2791943

File tree

5 files changed

+135
-1
lines changed

5 files changed

+135
-1
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Documentation Build and Publish to Zoomin
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
documentation_tag:
7+
type: string
8+
required: false
9+
default: "latest"
10+
description: "Label of the documentation"
11+
publish_to_prod:
12+
type: boolean
13+
default: false
14+
publish_to_dev:
15+
type: boolean
16+
default: true
17+
18+
workflow_call:
19+
inputs:
20+
documentation_tag:
21+
type: string
22+
required: true
23+
default: "latest"
24+
publish_to_prod:
25+
type: boolean
26+
default: false
27+
publish_to_dev:
28+
type: boolean
29+
default: true
30+
31+
jobs:
32+
docs-build-and-publish:
33+
env:
34+
ARCHIVE: "addon-thingy91x_oob_${{inputs.documentation_tag}}.zip"
35+
36+
runs-on: ubuntu-latest
37+
38+
concurrency:
39+
group: ${{ github.workflow }}-${{ github.ref }}
40+
cancel-in-progress: true
41+
42+
permissions:
43+
contents: write
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
49+
- name: Install dependencies
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install -y python3 python3-pip
53+
54+
- name: Install Python dependencies
55+
working-directory: docs
56+
run: |
57+
python3 -m pip install -r requirements.txt
58+
59+
- name: Build documentation
60+
working-directory: docs
61+
run: |
62+
sphinx-build -M html . build
63+
64+
cp custom.properties build/html
65+
sed -i 's/__VERSION__/'"${{inputs.documentation_tag}}"'/g' build/html/custom.properties
66+
67+
cp tags.yml build/html
68+
sed -i 's/__VERSION__/'"${{inputs.documentation_tag}}"'/g' build/html/tags.yml
69+
70+
cd build/html
71+
72+
zip -rq "${{env.ARCHIVE}}" .
73+
ls -lah .
74+
75+
- name: Upload artifact
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: doc-build
79+
if-no-files-found: error
80+
retention-days: 2
81+
path: |
82+
docs/build/html/${{env.ARCHIVE}}
83+
84+
- name: Prepare Key
85+
run: |
86+
mkdir -p /root/.ssh
87+
ssh-keyscan upload-v1.zoominsoftware.io >> /root/.ssh/known_hosts
88+
89+
echo "${{ secrets.ZOOMIN_KEY }}" > zoomin_key
90+
chmod 600 zoomin_key
91+
92+
- name: Publish documentation - prod
93+
if: ${{inputs.publish_to_prod}}
94+
run: |
95+
sftp -v -i zoomin_key [email protected] <<EOF
96+
cd docs-be.zoominsoftware.io/sphinx-html/incoming
97+
put docs/build/html/${{env.ARCHIVE}}
98+
EOF
99+
100+
- name: Publish documentation - dev
101+
if: ${{inputs.publish_to_dev}}
102+
run: |
103+
sftp -v -i zoomin_key [email protected] <<EOF
104+
cd nordic-be-dev.zoominsoftware.io/sphinx-html/incoming
105+
put docs/build/html/${{env.ARCHIVE}}
106+
EOF

.github/workflows/docs-build-and-publish.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- main
88
paths:
99
- '.github/workflows/docs-build-and-publish.yml'
10-
- 'docs/**'
1110
push:
1211
branches:
1312
- main
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Publish latest documentation on push to main
2+
name: Publish latest documentation on push
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'doc/**'
10+
11+
jobs:
12+
deploy:
13+
uses: ./.github/workflows/docs-build-and-publish.yml
14+
with:
15+
documentation_tag: "latest"
16+
publish_to_prod: false
17+
publish_to_dev: true
18+
secrets: inherit

docs/custom.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
manual.name=addon-nrfcloud_firmware-__VERSION__
2+
booktitle=Hello nRF Cloud firmware Add-on __VERSION__

docs/tags.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Document tags for Zoomin.
2+
3+
# Tags for all topics:
4+
mapping_global:
5+
- addon-hello-nrfcloud-firmware-__VERSION__
6+
- cluster-addon-hello-nrfcloud-firmware-__VERSION__
7+
8+
# Tags for individual topics:
9+
mapping_topics:

0 commit comments

Comments
 (0)