# Copyright (c) 2020 Linaro Limited.
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

name: Documentation Publish (Pull Request)

on:
  workflow_run:
    workflows: ["Documentation Build"]
    types:
    - completed

jobs:
  doc-publish:
    name: Publish Documentation
    runs-on: ubuntu-22.04
    if: |
      github.event.workflow_run.event == 'pull_request' &&
      github.event.workflow_run.conclusion == 'success' &&
      github.repository == 'zephyrproject-rtos/zephyr'

    steps:
    - name: Download artifacts
      id: download-artifacts
      uses: dawidd6/action-download-artifact@v6
      with:
        workflow: doc-build.yml
        run_id: ${{ github.event.workflow_run.id }}
        if_no_artifact_found: ignore

    - name: Load PR number
      if: steps.download-artifacts.outputs.found_artifact == 'true'
      uses: actions/github-script@v7
      with:
        script: |
          let fs = require("fs");
          let pr_number = Number(fs.readFileSync("./pr_num/pr_num"));
          core.exportVariable("PR_NUM", pr_number);

    - name: Check PR number
      if: steps.download-artifacts.outputs.found_artifact == 'true'
      id: check-pr
      uses: carpentries/actions/check-valid-pr@v0.14.0
      with:
        pr: ${{ env.PR_NUM }}
        sha: ${{ github.event.workflow_run.head_sha }}

    - name: Validate PR number
      if: |
        steps.download-artifacts.outputs.found_artifact == 'true' &&
        steps.check-pr.outputs.VALID != 'true'
      run: |
        echo "ABORT: PR number validation failed!"
        exit 1

    - name: Uncompress HTML docs
      if: steps.download-artifacts.outputs.found_artifact == 'true'
      run: |
        tar xf html-output/html-output.tar.xz -C html-output
        if [ -f api-coverage/api-coverage.tar.xz ]; then
          tar xf api-coverage/api-coverage.tar.xz -C api-coverage
        fi

    - name: Configure AWS Credentials
      if: steps.download-artifacts.outputs.found_artifact == 'true'
      uses: aws-actions/configure-aws-credentials@v4
      with:
        aws-access-key-id: ${{ vars.AWS_BUILDS_ZEPHYR_PR_ACCESS_KEY_ID }}
        aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_PR_SECRET_ACCESS_KEY }}
        aws-region: us-east-1

    - name: Upload to AWS S3
      if: steps.download-artifacts.outputs.found_artifact == 'true'
      env:
        HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
      run: |
        aws s3 sync --quiet html-output/html \
          s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/docs \
          --delete
        if [ -d api-coverage/coverage-report ]; then
          aws s3 sync --quiet api-coverage/coverage-report/ \
            s3://builds.zephyrproject.org/${{ github.event.repository.name }}/pr/${PR_NUM}/api-coverage \
            --delete
        fi
