forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.39 KB
/
docpublish.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
name: Documentation Publish
on:
workflow_run:
workflows: ["Documentation Build"]
types:
- completed
jobs:
publish:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v6
with:
workflow: docbuild.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Unzip html archive
working-directory: docs
run: |
OUTDIR=$(awk 'NR==1 { if ($3 ~ /^(latest|v([0-9a-z\.\-]+)|PR-[0-9]+)$/) print $3 }' monitor_*.txt)
echo "OUTDIR=$OUTDIR" >> "$GITHUB_ENV"
unzip legacy-ncs*.zip -d $OUTDIR
- name: Upload to Azure storage
working-directory: docs
env:
AZCOPY_CONCURRENCY_VALUE: 1024
run: |
azcopy cp $OUTDIR "${{ vars.NCS_DOC_STORAGE_URL }}?${{ secrets.NCS_DOC_SAS}}" --recursive=true
- name: Upload Zoomin documentation
run: |
for file in docs/monitor*.txt; do
if ! grep -q main ${file}; then
echo "Not targeting main, skipping Zoomin upload"
exit 0
fi
done
# trust server
mkdir -p ~/.ssh
ssh-keyscan upload-v1.zoominsoftware.io >> ~/.ssh/known_hosts
# prepare key
echo "${{ secrets.NCS_ZOOMIN_KEY }}" | base64 -d > zoomin_key
chmod 600 zoomin_key
# upload files
for file in docs/*-apis-*.zip; do
sftp -v -i zoomin_key [email protected] <<EOF
cd docs-be.nordicsemi.com/doxygen/incoming
put ${file}
cd ../../../nordic-be-dev.zoominsoftware.io/doxygen/incoming
put ${file}
quit
EOF
done
for file in docs/ncs-*.zip; do
sftp -v -i zoomin_key [email protected] <<EOF
cd docs-be.nordicsemi.com/sphinx-html/incoming
put ${file}
cd ../../../nordic-be-dev.zoominsoftware.io/sphinx-html/incoming
put ${file}
quit
EOF
done
- name: Add preview URL comment for PRs
uses: nrfconnect/action-doc-url@main
with:
github-token: ${{ secrets.NCS_GITHUB_TOKEN }}
urlroot: ${{ vars.NCS_DOC_HOSTING_URL }}
pr-prefix: "PR-"
pr-file: docs/pr.txt