Documentation Publish #6
This file contains hidden or 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 | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| 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@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6 | |
| with: | |
| workflow: doc-build.yml | |
| run_id: ${{ github.event.workflow_run.id }} | |
| name: docs | |
| path: doc | |
| - name: Unzip html archive | |
| working-directory: doc | |
| 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-addon-serial-modem*.zip -d "$OUTDIR" | |
| find "$OUTDIR" -type l -delete | |
| - name: Prepare Key | |
| run: | | |
| mkdir -p ~/.ssh | |
| ssh-keyscan upload-v1.zoominsoftware.io >> ~/.ssh/known_hosts | |
| echo "${{ secrets.ZOOMIN_KEY }}" > zoomin_key | |
| chmod 600 zoomin_key | |
| - name: Publish documentation - prod | |
| if: ${{inputs.publish_to_prod}} | |
| run: | | |
| sftp -v -i zoomin_key nordic@upload-v1.zoominsoftware.io <<EOF | |
| cd docs-be.nordicsemi.com/sphinx-html/incoming | |
| put doc/build/html/${{env.ARCHIVE}} | |
| EOF | |
| - name: Publish documentation - dev | |
| if: ${{inputs.publish_to_dev}} | |
| run: | | |
| sftp -v -i zoomin_key nordic@upload-v1.zoominsoftware.io <<EOF | |
| cd nordic-be-dev.zoominsoftware.io/sphinx-html/incoming | |
| put doc/build/html/${{env.ARCHIVE}} | |
| EOF |