diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 602fca8..4871b94 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,48 +13,89 @@ on: # yamllint disable-line rule:truthy - '.github/workflows/docs.yaml' workflow_dispatch: -permissions: read-all +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true -jobs: +permissions: + contents: read +jobs: build-docs: - runs-on: ubuntu-latest - timeout-minutes: 3 + name: Build Documentation + runs-on: ubuntu-slim + timeout-minutes: 5 + permissions: + contents: read steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false # Avoids exposing secrets to forks - name: Setup uv - uses: astral-sh/setup-uv@v6 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + with: + enable-cache: false # Disable caching to minimize storage usage - name: Install dependencies run: uv sync && uv pip install ./mule ./um_utils - name: Build mule docs - run: uv run make clean html --directory ./mule/docs - working-directory: ${{ github.workspace }} + run: uv run make clean html --directory "${GITHUB_WORKSPACE}/mule/docs" - name: Build um_utils docs - run: uv run make clean html --directory ./um_utils/docs - working-directory: ${{ github.workspace }} + run: uv run make clean html --directory "${GITHUB_WORKSPACE}/um_utils/docs" - # Deploy Steps + # Prepare landing page and copy built documentation to a temporary directory for upload - name: Copy Built Documentation - if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' + if: github.repository == 'MetOffice/mule' && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' run: | mkdir _docs cp -r ./mule/docs/build/html _docs/mule cp -r ./um_utils/docs/build/html _docs/um_utils - echo '
' > _docs/index.html + cat << 'EOF' > _docs/index.html + + + + + +