Skip to content

Publish documentation #23

Publish documentation

Publish documentation #23

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-latest
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: Publish documentation - dev
if: ${{inputs.publish_to_dev}}
uses: wlixcc/[email protected]
with:
username: ${{ vars.NCS_ZOOMIN_USER }}
server: ${{ vars.NCS_ZOOMIN_SERVER }}
ssh_private_key: ${{ secrets.NCS_ZOOMIN_KEY }}
local_path: '/workdir/${{env.ARCHIVE}}'
remote_path: ${{ vars.NCS_ZOOMIN_DEPLOY_DEV_PATH}}
sftpArgs: '-o ConnectTimeout=5'
- name: Publish documentation - prod
if: ${{inputs.publish_to_prod}}
uses: wlixcc/[email protected]
with:
username: ${{ vars.NCS_ZOOMIN_USER }}
server: ${{ vars.NCS_ZOOMIN_SERVER }}
ssh_private_key: ${{ secrets.NCS_ZOOMIN_KEY }}
local_path: '/workdir/${{env.ARCHIVE}}'
remote_path: ${{ vars.NCS_ZOOMIN_DEPLOY_PROD_PATH}}
sftpArgs: '-o ConnectTimeout=5'