Documenter devbranch build not deploying

Our GitHub actions for building our Documenter docs recently started misbehaving. One issue is that when I manually run out GitHub Documentation action, it doesn’t update the “dev” version of our docs.

Here is the error message I see:

┌ Info: Deployment criteria for deploying devbranch build from GitHub Actions:
82
│ - ✔ ENV["GITHUB_REPOSITORY"]="ITensor/ITensors.jl" occurs in repo="github.com/ITensor/ITensors.jl.git"
83
│ - ✘ ENV["GITHUB_EVENT_NAME"]="workflow_dispatch" is "push"
84
│ - ✔ ENV["GITHUB_REF"] matches devbranch="main"
85
│ - ✔ ENV["GITHUB_ACTOR"] exists and is non-empty
86
│ - ✔ ENV["DOCUMENTER_KEY"] exists and is non-empty
87
└ Deploying: ✘

Apparently the problem is a mismatch between the actual and expected value of the ENV["GITHUB_EVENT_NAME"] environment variable.

However, I’m having trouble figuring out:

  1. what do actually do to change this environment variable?
  2. if I change it to “push”, will that break other ways that this action gets run (e.g. manually running it versus it running as part of our continuous integration on PR’s)?

Thanks –
Miles

Following up on this, does Documenter.jl simply not support deploying a devbranch build for the case of a “workflow_dispatch” action (i.e. one initiated manually)? I’m still working to understand what our options might be here.

Our setup does work and build the docs when the action is “push”. It is, however, having some issues when the action is “pull_request” unfortunately.

Documenter predates workflow_dispatch, so yeah, deploydocs just doesn’t know what do with it. But I think we should support it, although I am not sure whether it should be exactly equivalent to push or not.

It should be completely fine if you do something like

if get(ENV, "GITHUB_EVENT_NAME", nothing) == "workflow_dispatch"
    ENV["GITHUB_EVENT_NAME"] = "push"
end

just before deploydocs.

1 Like

Your solution worked very well, thank you. It’s helpful to know also why the issue happened (Documenter not being aware of workflow_dispatch.)

Now I can update our docs without running the whole CI (by appending [no ci] to the commit message) then just build our docs manually through the GitHub actions interface.

2 Likes