Skip to content

Add opt-in docs artifact upload to documentation.yml - #146

Open
isaacsas wants to merge 1 commit into
SciML:masterfrom
isaacsas:docs-upload-artifact
Open

isaacsas wants to merge 1 commit into
SciML:masterfrom
isaacsas:docs-upload-artifact

Conversation

@isaacsas

@isaacsas isaacsas commented Nov 1, 2026

Copy link
Copy Markdown
Member

Motivation

For pull requests opened from forks, documentation.yml cannot deploy a Documenter preview (see CAN_DEPLOY_DOCS), so the job only reports whether the documentation builds. Reviewers have no way to download and look at the rendered pages. A package with an inline docs workflow can add an actions/upload-artifact step after the build (Catalyst.jl does), but a caller of a reusable workflow cannot add steps to its job, so packages that switch to this workflow lose that option. This came up for JumpProcesses.jl, whose Documentation.yml now calls this workflow.

Change

Two new optional inputs. The defaults leave existing callers unchanged.

Input Type Default Description
upload-artifact boolean false Upload docs/build as the workflow artifact docs-artifact.
artifact-retention-days number 3 Days to keep that artifact (0 uses the repository default).

The new step runs actions/upload-artifact@v7 right after the build step, before the coverage steps so a coverage problem can't block it. It uses compression-level: 9, and overwrite: true so an existing artifact of the same name in the run is replaced instead of failing the upload. Its if: has no status function, so it runs only when the build succeeded; a failed build has nothing useful to upload. When enabled, it uploads on every successful run (push, tag or pull request), not only for fork pull requests; the short default retention keeps storage small.

The README's documentation.yml input table gets the two new rows and a short note on when to use them.

Usage

jobs:
  docs:
    uses: "SciML/.github/.github/workflows/documentation.yml@v1"
    secrets: "inherit"
    with:
      upload-artifact: true

The rendered site then appears as docs-artifact in the run's Artifacts list.

Testing

actionlint 1.7.12 (the version this repository's CI uses), with shellcheck, reports no errors for the repository's workflows, and it checks the new step's inputs against actions/upload-artifact@v7. The new step has not been exercised in a live run yet.

Callers on @v1 will pick this up once a new v1.x release is tagged.

🤖 Generated with Claude Code 2.1.316 (model: claude-opus-5-5)

Pull requests from forks cannot deploy a Documenter preview, so the
reusable documentation workflow only reports whether their docs build,
and reviewers have no way to look at the rendered pages. Callers of a
reusable workflow cannot add steps to its job, so packages that moved
from an inline docs workflow (which could upload docs/build itself) to
this one lost that option.

Add an `upload-artifact` input (default false, so existing callers are
unaffected) that uploads docs/build as the `docs-artifact` workflow
artifact after a successful build, and an `artifact-retention-days`
input (default 3) to control how long it is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant