1# Copyright (c) 2020 Linaro Limited. 2# Copyright (c) 2021 Nordic Semiconductor ASA 3# SPDX-License-Identifier: Apache-2.0 4 5name: Documentation Publish 6 7on: 8 workflow_run: 9 workflows: ["Documentation Build"] 10 branches: 11 - main 12 - v* 13 types: 14 - completed 15 16jobs: 17 doc-publish: 18 name: Publish Documentation 19 runs-on: ubuntu-22.04 20 if: | 21 github.event.workflow_run.event != 'pull_request' && 22 github.event.workflow_run.conclusion == 'success' && 23 github.repository == 'zephyrproject-rtos/zephyr' 24 25 steps: 26 - name: Download artifacts 27 uses: dawidd6/action-download-artifact@v2 28 with: 29 workflow: doc-build.yml 30 run_id: ${{ github.event.workflow_run.id }} 31 32 - name: Uncompress HTML docs 33 run: | 34 tar xf html-output/html-output.tar.xz -C html-output 35 36 - name: Configure AWS Credentials 37 uses: aws-actions/configure-aws-credentials@v2 38 with: 39 aws-access-key-id: ${{ vars.AWS_DOCS_ACCESS_KEY_ID }} 40 aws-secret-access-key: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }} 41 aws-region: us-east-1 42 43 - name: Upload to AWS S3 44 env: 45 HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} 46 run: | 47 if [ "${HEAD_BRANCH:0:1}" == "v" ]; then 48 VERSION=${HEAD_BRANCH:1} 49 else 50 VERSION="latest" 51 fi 52 53 aws s3 sync --quiet html-output/html s3://docs.zephyrproject.org/${VERSION} --delete 54 aws s3 sync --quiet html-output/html/doxygen/html s3://docs.zephyrproject.org/apidoc/${VERSION} --delete 55 aws s3 cp --quiet pdf-output/zephyr.pdf s3://docs.zephyrproject.org/${VERSION}/zephyr.pdf 56