# Documenter not uploading previews of pull requests

**URL:** <https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786>\
**Category:** Tooling\
**Tags:** documentation, documenter\
**Created:** [January 30, 2023, 6:05pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786 "2023-01-30T18:05:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [January 30, 2023, 6:05pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/1 "2023-01-30T18:05:02Z")

</div>

I have Documenter working nicely and deploying my main-branch docs to gh-pages — including both `dev`, `stable`, and the various releases. But now I want to see what the docs look like in a PR. From what I can tell of [this announcement](https://discourse.julialang.org/t/ann-documenter-0-24/31381) and [the documentation](https://documenter.juliadocs.org/dev/lib/public/#Documenter.deploydocs), Documenter should do this for me when I add the argument `push_preview=true` in the `deploydocs` function]. More specifically, it should add a folder under my `gh-pages` branch named `preview`, and a subfolder named `PR15` (for PR #15 in my repo), which should then get served as usual when I go to the appropriate URL.

While the github action is running, it doesn’t seem to care about this new argument. The docs build properly, but near the end, all I see is this:

```julia
┌ Info: Deployment criteria for deploying devbranch build from GitHub Actions:
│ - ✔ ENV["GITHUB_REPOSITORY"]="moble/SphericalFunctions.jl" occurs in repo="github.com/moble/SphericalFunctions.jl.git"
│ - ✔ ENV["GITHUB_EVENT_NAME"]="push" is "push"
│ - ✘ ENV["GITHUB_REF"] matches devbranch="main"
│ - ✔ ENV["GITHUB_ACTOR"] exists and is non-empty
│ - ✔ ENV["GITHUB_TOKEN"] exists and is non-empty
└ Deploying: ✘

```

Since I’m making the PR in a branch (from `main`), that third test fails, and it evidently doesn’t deploy for that reason. Is there something else I’m supposed to do? I’ve seen the warning about forks, but this is not a fork.

(In case it helps, [the PR is here](https://github.com/moble/SphericalFunctions.jl/pull/15). There are lots of changes, but I suppose the only relevant one should be to `docs/make.jl`.)

---

<div class="post-metadata">

**Author:** ![j-fu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j-fu/32/11373_2.png) [@j-fu](https://discourse.julialang.org/u/j-fu)\
**Post date:** [January 30, 2023, 6:42pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/2 "2023-01-30T18:42:56Z")

</div>

I don’t know about the deployment stuff, but if it would be sufficient for you to preview on your computer, you can use `LiveServer.jl` to serve the content of `docs/build` to `localhost`. You’d better set `clean = false` in the call to `makedocs`.

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [January 30, 2023, 7:55pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/3 "2023-01-30T19:55:19Z")

</div>

If you look at the CI you see here

> <https://github.com/moble/SphericalFunctions.jl/actions/runs/4046558100/jobs/6959491836#step:5:25>

that it currently only deploys on main.  
In your CI you could move to

```julia
- uses: julia-actions/julia-docdeploy@releases/v1

```

see for example [Manopt.jl/documenter.yml at master · JuliaManifolds/Manopt.jl · GitHub](https://github.com/JuliaManifolds/Manopt.jl/blob/master/.github/workflows/documenter.yml) (but that is just a little bit simpler in CI, maybe not the error),

I am not sure about your `devbranch` keyword, but it does not do harm, I think.  
You are missing `push_preview=true` here

> <https://github.com/moble/SphericalFunctions.jl/blob/14eb84b83523941bfc7848b4dda84311681da6ef/docs/make.jl#L29-L32>

cf. for example

> <https://github.com/JuliaManifolds/Manopt.jl/blob/master/docs/make.jl#L132>

or see the description at [Public · Documenter.jl](https://documenter.juliadocs.org/stable/lib/public/#Documenter.deploydocs)

For example this CI run shows that you do not get the check for push\_preview it seems? The following is what a recent CI run on my repo does

> <https://github.com/JuliaManifolds/Manopt.jl/actions/runs/4047424957/jobs/6961425444#step:4:910>

_edit:_ Oh for your code I missed that I looked at master. Looking at your CI – you are still running Documenter 0.26 – maybe updating that to 0.27 helps? Though not sure.

---

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [January 30, 2023, 10:11pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/4 "2023-01-30T22:11:48Z")

</div>

Thanks for taking a look. Like you said in your edit, I can confirm that I am actually using `push_preview=true`.

Also, I should have pointed out that I tried both with and without the `devbranch` keyword. The only difference without it is that instead of

```julia
│ - ✘ ENV["GITHUB_REF"] matches devbranch="main"

```

it looks for the non-existent master branch, and I get

```julia
│ - ✘ ENV["GITHUB_REF"] matches devbranch="master"

```

Looking at your code, I realized that I was indeed using a somewhat older CI setup, so I ran PkgTemplate to see what the current recommended setup looks like, and modified my docs.yml to emulate it. In particular, I used this `julia-docdeploy` action that I hadn’t seen before.

Long story short: I get the same result. It still sees that GITHUB\_REF is not “main”, and still skips deployment.

---

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [January 30, 2023, 10:18pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/5 "2023-01-30T22:18:44Z")

</div>

Ah, but it does appear to be true that Documenter 0.26 is pretty out of date, so I’ll look into what’s keeping that so low.

EDIT: Hmm. Maybe it’s that compat line in `docs/Project.toml` that specifically says 0.26…

---

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [January 30, 2023, 10:31pm UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/6 "2023-01-30T22:31:25Z")

</div>

Same result with Documenter v0.27.24. ☹

---

<div class="post-metadata">

**Author:** ![moble](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moble/32/23535_2.png) [@moble](https://discourse.julialang.org/u/moble)\
**Post date:** [January 31, 2023, 2:21am UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/7 "2023-01-31T02:21:40Z")

</div>

I should have checked the issues more carefully: the solution is explained [here](https://github.com/JuliaDocs/Documenter.jl/issues/1230#issuecomment-579450827). The action was triggered on all pushes, and not on PRs. [This commit](https://github.com/moble/SphericalFunctions.jl/pull/15/commits/2d57eeccfad7e1d0d0c60163e79929eddf27ce6c) changed that in my repo, and the preview was successfully created.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [January 31, 2023, 5:45am UTC](https://discourse.julialang.org/t/documenter-not-uploading-previews-of-pull-requests/93786/8 "2023-01-31T05:45:17Z")

</div>

Ah, that I did not check, great that you found it!
