Files
Keval MorabiaandClaude Opus 5 30b68c38c7 Bump the Node 20 actions that have no behavior change (#2102)
### What does this PR do?

Type of change: CI/CD maintenance

Clears the [Node 20
deprecation](https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/)
warnings. The runner already forces these onto Node 24, so this changes
what the actions *declare*, not how they run.

| action | bump | why it is safe |
|---|---|---|
| `actions/cache` | v4 → v6 | v5 requires runner >= 2.327.1; our
self-hosted GPU runners report **2.336.0** |
| `actions/download-artifact` | v4 → v8 | v5's breaking change affects
downloads **by artifact ID**; `pages.yml` downloads by `name: docs-html`
|
| `actions/upload-artifact` | v4 → v7 | node24 runtime only |
| `dorny/paths-filter` | v3 → v4 | node24 runtime only |
| `poseidon/wait-for-status-checks` | v0.6.0 → v0.7.0 | node24 runtime
only |

`step-security/changed-files` stays at v46.0.5 and is bumped in a
separate PR: the lane gating depends on its `files_yaml` group outputs
and `any_modified` semantics, and v47 ships no release notes covering
them. Splitting keeps a gating regression attributable.

### Testing

`actions/cache` is exercised by every GPU job through
`cache-extensions`; the `pages.yml` three are exercised by the docs
build. Worth watching on this PR: cache **hit rate** rather than just
success, since a silent cache-key change costs build time without
failing.

### Before your PR is "*Ready for review*"

- Is this change backward compatible?: ✅
- If you copied code from any other sources or added a new PIP
dependency, did you follow guidance in `CONTRIBUTING.md`: N/A
- Did you write any new necessary tests?: N/A — CI configuration
- Did you update
[Changelog](https://github.com/NVIDIA/Model-Optimizer/blob/main/CHANGELOG.rst)?:
N/A
- Did you get Claude approval on this PR?: ❌ — not yet run

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Chores**
* Updated automated caching and build workflow actions to newer
versions.
  * Improved pull request status-check handling.
* Updated artifact upload, download, and path-filtering actions used by
page deployments and tests.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 16:06:58 +05:30

101 lines
3.0 KiB
YAML

name: Docs
on:
pull_request:
types: [opened, synchronize, reopened, closed]
branches: [main, release/*, feature/*]
push:
branches: [main]
schedule:
- cron: "0 0 * * *" # Nightly
workflow_dispatch:
# On-demand
concurrency:
# Cancel previous runs if new commit is pushed
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: write # push to gh-pages branch
pull-requests: write # post/update preview URL comment on PRs
jobs:
build-docs:
if: github.event.action != 'closed'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/ubuntu-setup
- name: Build docs
run: pip install nox uv && nox -s docs
- name: Upload docs artifact
uses: actions/upload-artifact@v7
with:
name: docs-html
path: docs/build/html
retention-days: 1
changes:
if: github.event_name == 'pull_request' && github.event.action != 'closed'
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
docs:
- 'docs/**'
- 'modelopt/**'
- '.github/workflows/pages.yml'
deploy-preview:
# Fork PRs get a read-only GITHUB_TOKEN regardless of the `permissions:` block
# above, so pushing the preview to gh-pages would fail with a 403. Skip them.
if: |
always() &&
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event.action == 'closed' || needs.changes.outputs.docs == 'true')
needs: [build-docs, changes]
runs-on: ubuntu-latest
timeout-minutes: 10
# Per-PR concurrency without cancel-in-progress so 'closed' cleanup always runs
concurrency:
group: pr-preview-${{ github.event.pull_request.number }}
steps:
- uses: actions/checkout@v6
- name: Download docs artifact
if: github.event.action != 'closed'
uses: actions/download-artifact@v8
with:
name: docs-html
path: docs/build/html
- name: Deploy / remove PR preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: docs/build/html
deploy-gh-pages:
if: github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: build-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Download docs artifact
uses: actions/download-artifact@v8
with:
name: docs-html
path: docs/build/html
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/build/html
single-commit: true
# Preserve PR preview subdirectories deployed by the deploy-preview job
clean-exclude: pr-preview