Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
pages: read
outputs:
artifact_id: ${{ steps.upload.outputs.artifact_id }}
deferred: ${{ steps.admission.outputs.deferred }}
failures: ${{ steps.docs.outputs.failures }}
steps:
- name: Checkout source from main
Expand All @@ -44,20 +45,38 @@ jobs:
fetch-depth: 0
fetch-tags: true

- name: Check whether source CI is still running
id: admission
if: github.event_name == 'workflow_run'
env:
GH_TOKEN: ${{ github.token }}
run: |
source_commit=$(git rev-parse HEAD)
status=$(gh api --method GET "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs" \
-f "head_sha=$source_commit" -f event=push -F per_page=1 \
--jq '.workflow_runs[0].status // empty')
if [[ -n "$status" && "$status" != completed ]]; then
echo 'deferred=true' >> "$GITHUB_OUTPUT"
echo "Documentation for $source_commit is deferred until push CI completes (current status $status)." >> "$GITHUB_STEP_SUMMARY"
fi

- name: Set up JDK
if: steps.admission.outputs.deferred != 'true'
uses: actions/setup-java@v6.3.0
with:
distribution: zulu
java-version: '17'

- name: Set up Gradle
if: steps.admission.outputs.deferred != 'true'
uses: gradle/actions/setup-gradle@v6.4.1
with:
validate-wrappers: true
dependency-graph: disabled

- name: Reconcile and save documentation archive
id: docs
if: steps.admission.outputs.deferred != 'true'
uses: connectbot/actions/docs@main
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -67,7 +86,7 @@ jobs:
require-ci: 'true'

- name: Preserve build logs
if: always()
if: always() && steps.admission.outputs.deferred != 'true'
uses: actions/upload-artifact@v7.0.2
with:
name: documentation-build-logs
Expand Down Expand Up @@ -110,13 +129,14 @@ jobs:
path: ${{ runner.temp }}/docs-site

- name: Report unavailable site
if: steps.docs.outputs.ready != 'true'
if: steps.admission.outputs.deferred != 'true' && steps.docs.outputs.ready != 'true'
run: |
echo '::error::No documentation site is ready. See the job summary and build logs.'
exit 1

deploy:
needs: assemble
if: needs.assemble.outputs.deferred != 'true'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
Expand Down
Loading