diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 22baf803..8fb21ab3 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -1,13 +1,10 @@ name: Docs on: - pull_request: + push: branches: [main] - types: [opened, synchronize] paths: - "docs/**" - push: - branches: [main] workflow_dispatch: defaults: @@ -18,7 +15,7 @@ env: MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: @@ -51,20 +48,6 @@ jobs: path: _build/docs if-no-files-found: error retention-days: 1 - - name: Store PR information - if: github.event_name == 'pull_request' - run: | - mkdir ./pr - echo ${{ github.event.number }} > ./pr/pr.txt - echo ${{ github.event.pull_request.merged }} > ./pr/merged.txt - echo ${{ github.event.action }} > ./pr/action.txt - - - name: Upload PR information - if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: pr - path: pr/ publish: if: false # disabled until GitHub Pages is configured diff --git a/.github/workflows/docs-preview-pr.yml b/.github/workflows/docs-preview-pr.yml index dac12aab..a24e6d0e 100644 --- a/.github/workflows/docs-preview-pr.yml +++ b/.github/workflows/docs-preview-pr.yml @@ -1,18 +1,57 @@ name: docs-preview-pr on: - workflow_run: - workflows: [Docs] - types: [completed] - branches-ignore: [main] + pull_request: + branches: [main] + types: [opened, reopened, synchronize, closed] + paths: + - "docs/**" concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: preview-${{ github.ref }} cancel-in-progress: true +permissions: + contents: write + pull-requests: write + packages: read + +defaults: + run: + shell: bash + env: - WF_ID: ${{ github.event.workflow_run.id }} + MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: preview: - uses: nvidia-merlin/.github/.github/workflows/docs-preview-pr-common.yaml@main + runs-on: build-arm64 + container: + image: ghcr.io/nvidia/nemoclaw/ci:latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install tools + run: mise install + + - name: Build documentation + if: github.event.action != 'closed' + run: mise run docs:build:strict + + - name: Delete unnecessary files + if: github.event.action != 'closed' + run: | + find _build -name .doctrees -prune -exec rm -rf {} \; + find _build -name .buildinfo -exec rm {} \; + + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./_build/docs/ + preview-branch: gh-pages + umbrella-dir: pr-preview + action: auto diff --git a/deploy/docker/Dockerfile.ci b/deploy/docker/Dockerfile.ci index 935573cd..5406a5c0 100644 --- a/deploy/docker/Dockerfile.ci +++ b/deploy/docker/Dockerfile.ci @@ -32,6 +32,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ socat \ unzip \ xz-utils \ + jq \ + rsync \ && rm -rf /var/lib/apt/lists/* # Install Docker CLI and buildx plugin used by CI jobs diff --git a/docs/index.md b/docs/index.md index 7c9584fd..98e8ae1b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -249,3 +249,4 @@ troubleshooting resources/eula ``` +