diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 22baf8032..e4f2afefe 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -65,87 +65,3 @@ jobs: with: name: pr path: pr/ - - publish: - if: false # disabled until GitHub Pages is configured - needs: [build] - runs-on: build-arm64 - container: - image: ghcr.io/nvidia/nemoclaw/ci:latest - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v4 - with: - ref: "gh-pages" - - - name: Initialize Git configuration - run: | - git config --global --add safe.directory "$GITHUB_WORKSPACE" - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: html-build-artifact - path: ${{ github.ref_name }} - - - name: Copy HTML directories - run: | - ls -asl - for i in `ls -d *` - do - echo "Git adding ${i}" - git add "${i}" - done - - name: Check or create dot-no-jekyll file - - run: | - if [ -f ".nojekyll" ]; then - echo "The dot-no-jekyll file already exists." - exit 0 - fi - touch .nojekyll - git add .nojekyll - - - name: Check or create redirect page - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - resp=$(grep 'http-equiv="refresh"' index.html 2>/dev/null) || true - if [ -n "${resp}" ]; then - echo "The redirect file already exists." - exit 0 - fi - def_branch=$(gh api "repos/${GITHUB_REPOSITORY}" --jq ".default_branch") - html_url=$(gh api "repos/${GITHUB_REPOSITORY}/pages" --jq ".html_url") - echo '' > index.html - echo '' >> index.html - echo ' ' >> index.html - echo ' Redirect to documentation' >> index.html - echo ' ' >> index.html - echo ' ' >> index.html - echo ' ' >> index.html - echo ' ' >> index.html - echo ' ' >> index.html - echo ' ' >> index.html - echo '

Please follow the link to the ' >> index.html - echo ${def_branch}' branch documentation.

' >> index.html - echo ' ' >> index.html - echo '' >> index.html - git add index.html - - - name: Commit changes to the GitHub Pages branch - run: | - git status - if git commit -m 'Pushing changes to GitHub Pages.'; then - git push -f - else - echo "Nothing changed." - fi diff --git a/.github/workflows/release-docs.yml b/.github/workflows/release-docs.yml new file mode 100644 index 000000000..683c332f2 --- /dev/null +++ b/.github/workflows/release-docs.yml @@ -0,0 +1,104 @@ +name: Release docs +on: + workflow_dispatch: + inputs: + dry-run: + description: Whether to run the workflow in dry-run mode + required: true + type: boolean + default: true + publish-as-latest: + description: Publish as Latest stable version. + required: false + type: boolean + default: true + docs-version-override: + description: Docs version override. If not provided, defaults to the version of the commit's tag. + required: false + type: string + default: "" + notify-emails: + description: Email addresses to send the notification to. Format as "me@me.com,you@you.com". + required: false + type: string + default: "" + update-version-picker: + description: Update version picker. + required: false + type: boolean + default: true + github-ref: + description: Github ref to checkout + required: false + type: string + default: "" + workflow_call: + inputs: + dry-run: + description: Whether to run the workflow in dry-run mode + required: false + type: boolean + default: true + publish-as-latest: + description: Publish as Latest stable version. + required: false + type: boolean + default: true + docs-version-override: + description: Docs version if commit is not tagged + required: false + type: string + default: "" + notify-emails: + description: Email addresses to send the notification to. Format as "me@me.com,you@you.com". + required: false + type: string + default: "" + update-version-picker: + description: Update version picker. + required: false + type: boolean + default: true + github-ref: + description: Github ref to checkout + required: false + type: string + default: "" + +jobs: + build-docs: + uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_docs.yml@v0.67.0 + with: + ref: ${{ inputs.github-ref }} + + publish-docs: + runs-on: ubuntu-latest + needs: [build-docs] + steps: + - uses: actions/checkout@v4 + with: + repository: NVIDIA-NeMo/FW-CI-templates + ref: v0.74.0 + path: FW-CI-templates + + - uses: ./FW-CI-templates/.github/actions/publish-docs + with: + dry-run: ${{ inputs.dry-run }} + artifacts-name: docs-html + artifacts-path: _build/html + emails-csv: ${{ inputs.notify-emails && format('{0},{1}', vars.docs_release_emails, inputs.notify-emails) || vars.docs_release_emails }} + overwrite-latest-on-tag: ${{ inputs.publish-as-latest }} + docs-version-override: ${{ inputs.docs-version-override }} + update-version-picker: ${{ inputs.update-version-picker }} + run-on-version-tag-only: ${{ github.ref_name != 'main' }} + request-name: nemoclaw-publish-docs-${{ github.run_id }} + aws-region: ${{ vars.DOCS_AWS_REGION }} + aws-role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + akamai-host: ${{ secrets.AKAMAI_HOST }} + akamai-client-token: ${{ secrets.AKAMAI_CLIENT_TOKEN }} + akamai-client-secret: ${{ secrets.AKAMAI_CLIENT_SECRET }} + akamai-access-token: ${{ secrets.AKAMAI_ACCESS_TOKEN }} + s3-target-root: ${{ secrets.S3_BUCKET_NAME }} + s3-target-path: nvidia/nemoclaw