-
Notifications
You must be signed in to change notification settings - Fork 27
95 lines (82 loc) · 2.54 KB
/
publish_documentation.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
name: Publish documentation
on:
workflow_dispatch:
inputs:
documentation_tag:
type: string
required: false
default: "latest"
description: "Label of the documentation"
publish_to_prod:
type: boolean
default: true
publish_to_dev:
type: boolean
default: true
workflow_call:
inputs:
documentation_tag:
type: string
required: true
default: "latest"
publish_to_prod:
type: boolean
default: true
publish_to_dev:
type: boolean
default: true
jobs:
Publish_Documentation:
env:
ARCHIVE: "sidewalk_${{inputs.documentation_tag}}.zip"
runs-on: ubuntu-24.04
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2
defaults:
run:
shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
path: sidewalk
- name: Build documentation
run: |
cd sidewalk/doc
./build_local.sh
cp custom.properties build/html
sed -i 's/__VERSION__/'"${{inputs.documentation_tag}}"'/g' build/html/custom.properties
cp tags.yml build/html
sed -i 's/__VERSION__/'"${{inputs.documentation_tag}}"'/g' build/html/tags.yml
cd build/html
zip -rq "${{env.ARCHIVE}}" .
mv "${{env.ARCHIVE}}" /workdir/${{env.ARCHIVE}}
ls -lah /workdir
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: |
/workdir/${{env.ARCHIVE}}
- name: Prepare Key
run: |
mkdir -p /root/.ssh
ssh-keyscan ${{ vars.NCS_ZOOMIN_SERVER }} >> /root/.ssh/known_hosts
echo "${{ secrets.NCS_ZOOMIN_KEY }}" > zoomin_key
chmod 600 zoomin_key
- name: Publish documentation - dev
if: ${{inputs.publish_to_dev}}
run: |
sftp -v -i zoomin_key ${{vars.NCS_ZOOMIN_USER}}@${{ vars.NCS_ZOOMIN_SERVER }} <<EOF
cd ${{ vars.NCS_ZOOMIN_DEPLOY_DEV_PATH}}
put /workdir/${{env.ARCHIVE}}
EOF
- name: Publish documentation - prod
if: ${{inputs.publish_to_prod}}
run: |
sftp -v -i zoomin_key ${{vars.NCS_ZOOMIN_USER}}@${{ vars.NCS_ZOOMIN_SERVER }} <<EOF
cd ${{ vars.NCS_ZOOMIN_DEPLOY_PROD_PATH}}
put /workdir/${{env.ARCHIVE}}
EOF