Documentation Publish #82493
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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|PR-[0-9]+|[0-9]+\.[0-9a-zA-Z\.\-]+)$/) 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 |