diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 173e96111..62f109574 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -24,10 +24,10 @@ jobs: build: runs-on: linux-large-disk steps: + # Use the ref that triggered the workflow (e.g. branch chosen for workflow_dispatch). + # Do not pin ref: main here — that forced manual runs to build from main while testing other branches. - name: Checkout code uses: actions/checkout@v4 - with: - ref: main - name: Setup Pages uses: actions/configure-pages@v5 @@ -46,8 +46,16 @@ jobs: CONTAINER_ID=$(docker run -d nv-ingest-docs:latest) echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV + # docker wait reports the container exit code but does not fail the step if it is non-zero. + # Emit logs here and exit with the same code so CI fails on make docs and the log shows why. - name: Wait for the docs generation to complete in the container - run: docker wait $CONTAINER_ID + run: | + EXIT_CODE=$(docker wait "$CONTAINER_ID") + echo "Container exit code: ${EXIT_CODE}" + echo "--- Container logs (make docs output) ---" + docker logs "$CONTAINER_ID" + echo "--- End container logs ---" + exit "${EXIT_CODE}" - name: Copy generated docs site from the container run: docker cp $CONTAINER_ID:/workspace/docs/site ./generated-site diff --git a/.github/workflows/docs-deploy.yml b/.github/workflows/docs-deploy.yml index 023859880..27272ca59 100644 --- a/.github/workflows/docs-deploy.yml +++ b/.github/workflows/docs-deploy.yml @@ -20,10 +20,10 @@ jobs: name: Build Documentation runs-on: linux-large-disk steps: + # Use the ref that triggered the workflow (e.g. branch chosen for workflow_dispatch). + # Do not pin ref: main here — that forced manual runs to build from main while testing other branches. - name: Checkout code uses: actions/checkout@v4 - with: - ref: main - name: Setup Pages uses: actions/configure-pages@v5 @@ -44,8 +44,16 @@ jobs: CONTAINER_ID=$(docker run -d nv-ingest-docs:latest) echo "CONTAINER_ID=$CONTAINER_ID" >> $GITHUB_ENV + # docker wait reports the container exit code but does not fail the step if it is non-zero. + # Emit logs here and exit with the same code so CI fails on make docs and the log shows why. - name: Wait for documentation generation - run: docker wait $CONTAINER_ID + run: | + EXIT_CODE=$(docker wait "$CONTAINER_ID") + echo "Container exit code: ${EXIT_CODE}" + echo "--- Container logs (make docs output) ---" + docker logs "$CONTAINER_ID" + echo "--- End container logs ---" + exit "${EXIT_CODE}" - name: Copy generated docs from container run: docker cp $CONTAINER_ID:/workspace/docs/site ./generated-site diff --git a/Dockerfile b/Dockerfile index f89038926..4ae83b0a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -179,6 +179,7 @@ COPY docs docs COPY src src COPY api api COPY client client +COPY nemo_retriever nemo_retriever RUN --mount=type=cache,target=/root/.cache/uv \ uv pip install -r ./docs/requirements.txt