diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 049bb7c4571..3a31e724e74 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -6,17 +6,21 @@ on: push: branches: - main + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true + defaults: run: shell: bash + permissions: - id-token: write contents: read + jobs: - build: + + deploy-to-docs-rapidsai-org: name: Build (and deploy) runs-on: ubuntu-latest steps: @@ -47,7 +51,6 @@ jobs: # is resolved and deployed. run: | # zizmor: ignore[adhoc-packages] npm install --global --force @aschmidt8/netlify-cli - ARGS="" if [ "$GITHUB_REF_NAME" = "main" ]; then ARGS="--prod" @@ -55,3 +58,70 @@ jobs: netlify deploy "$ARGS" \ --debug \ --dir=_site + + compute-docs-nvidia-com-matrix: + name: Compute docs.nvidia.com matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + - name: Set matrix + id: set-matrix + env: + PROJECTS: cudf,cugraph,cuml,nvforest,rmm + run: | + MATRIX=$( + jq --compact-output --arg projects "$PROJECTS" ' + ($projects | split(",")) as $allowed | + [to_entries[] | select(.key | IN($allowed[])) | .key as $project | .value | to_entries[] | + {"project": $project, "named-version": .key, "numeric-version": .value}]' \ + ci/customization/projects-to-versions.json + ) + echo "matrix=${MATRIX}" >> "${GITHUB_OUTPUT}" + + publish-to-docs-nvidia-com: + name: Publish to docs.nvidia.com + container: + image: rapidsai/ci-conda:26.10-latest + options: -e _NOOP + needs: compute-docs-nvidia-com-matrix + permissions: + id-token: write + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.compute-docs-nvidia-com-matrix.outputs.matrix) }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6.2.0 + with: + aws-region: ${{ vars.AWS_REGION }} + role-to-assume: ${{ vars.AWS_ROLE_ARN }} + - name: Download docs + env: + PROJECT: ${{ matrix['project'] }} + NUMERIC_VERSION: ${{ matrix['numeric-version'] }} + run: | + aws s3 sync "s3://rapidsai-docs/${PROJECT}/html/${NUMERIC_VERSION}" ./docs/ + - name: Publish to docs.nvidia.com + uses: rapidsai/shared-actions/publish-docs@main + with: + akamai_access_token: ${{ secrets.NVIDIA_DOCS_AKAMAI_ACCESS_TOKEN }} + akamai_client_secret: ${{ secrets.NVIDIA_DOCS_AKAMAI_CLIENT_SECRET }} + akamai_client_token: ${{ secrets.NVIDIA_DOCS_AKAMAI_CLIENT_TOKEN }} + akamai_emails_to_notify: ${{ secrets.NVIDIA_DOCS_AKAMAI_EMAILS_TO_NOTIFY }} + akamai-host: ${{ secrets.NVIDIA_DOCS_AKAMAI_HOST }} + akamai-request-name: rapidsai-docs-${{ matrix['project'] }}-${{ matrix['named-version'] }} + dry-run: false + source-path: ./docs/ + target_aws_access_key_id: ${{ secrets.NVIDIA_DOCS_AWS_ACCESS_KEY_ID }} + target_aws_region: ${{ secrets.NVIDIA_DOCS_AWS_REGION }} + target_aws_secret_access_key: ${{ secrets.NVIDIA_DOCS_AWS_SECRET_ACCESS_KEY }} + target_s3_bucket: ${{ secrets.NVIDIA_DOCS_S3_BUCKET }} + target-s3-key-suffix: ${{ matrix['named-version'] }} + target-s3-key: ${{ matrix['project'] }} diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index d35a3931dd1..df2c1d91f4b 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -16,6 +16,7 @@ jobs: needs: - check-style - docs + - publish-to-docs-nvidia-com permissions: actions: read contents: read @@ -63,3 +64,70 @@ jobs: role-duration-seconds: 7200 - name: Assemble and validate complete documentation site run: make assemble + + compute-docs-nvidia-com-matrix: + name: Compute docs.nvidia.com matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + - name: Set matrix + id: set-matrix + env: + PROJECTS: cudf,cugraph,cuml,nvforest,rmm + run: | + MATRIX=$( + jq --compact-output --arg projects "$PROJECTS" ' + ($projects | split(",")) as $allowed | + [to_entries[] | select(.key | IN($allowed[])) | .key as $project | .value | to_entries[] | + {"project": $project, "named-version": .key, "numeric-version": .value}]' \ + ci/customization/projects-to-versions.json + ) + echo "matrix=${MATRIX}" >> "${GITHUB_OUTPUT}" + + publish-to-docs-nvidia-com: + name: Publish to docs.nvidia.com + container: + image: rapidsai/ci-conda:26.10-latest + options: -e _NOOP + needs: compute-docs-nvidia-com-matrix + permissions: + id-token: write + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.compute-docs-nvidia-com-matrix.outputs.matrix) }} + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e7f100cf4c008499ea8adda475de1042d6975c7b # v6.2.0 + with: + aws-region: ${{ vars.AWS_REGION }} + role-to-assume: ${{ vars.AWS_ROLE_ARN }} + - name: Download docs + env: + PROJECT: ${{ matrix['project'] }} + NUMERIC_VERSION: ${{ matrix['numeric-version'] }} + run: | + aws s3 sync "s3://rapidsai-docs/${PROJECT}/html/${NUMERIC_VERSION}" ./docs/ + - name: Publish to docs.nvidia.com + uses: rapidsai/shared-actions/publish-docs@main + with: + akamai_access_token: ${{ secrets.NVIDIA_DOCS_AKAMAI_ACCESS_TOKEN }} + akamai_client_secret: ${{ secrets.NVIDIA_DOCS_AKAMAI_CLIENT_SECRET }} + akamai_client_token: ${{ secrets.NVIDIA_DOCS_AKAMAI_CLIENT_TOKEN }} + akamai_emails_to_notify: ${{ secrets.NVIDIA_DOCS_AKAMAI_EMAILS_TO_NOTIFY }} + akamai-host: ${{ secrets.NVIDIA_DOCS_AKAMAI_HOST }} + akamai-request-name: rapidsai-docs-${{ matrix['project'] }}-${{ matrix['named-version'] }} + dry-run: true + source-path: ./docs/ + target_aws_access_key_id: ${{ secrets.NVIDIA_DOCS_AWS_ACCESS_KEY_ID }} + target_aws_region: ${{ secrets.NVIDIA_DOCS_AWS_REGION }} + target_aws_secret_access_key: ${{ secrets.NVIDIA_DOCS_AWS_SECRET_ACCESS_KEY }} + target_s3_bucket: ${{ secrets.NVIDIA_DOCS_S3_BUCKET }} + target-s3-key-suffix: ${{ matrix['named-version'] }} + target-s3-key: ${{ matrix['project'] }}