# Using Documenter.jl to in GitHub actions

**URL:** https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231
**Category:** General Usage
**Created:** [December 4, 2020, 12:50am UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231 "2020-12-04T00:50:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)
#### Post date: [December 4, 2020, 12:50am UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231/1 "2020-12-04T00:50:48Z")

</div>

The Documenter log seems to suggest that setting `push_preview=true` is necessary when generating docs from a git-hub action, as [here](https://github.com/alan-turing-institute/MLJBase.jl/blob/dev/.github/workflows/ci.yml)

 ![Screen Shot 2020-12-02 at 1.48.57 PM](https://global.discourse-cdn.com/julialang/original/3X/b/9/b9c82b6e85cbee6bb9d1cd2fa7d84c6ef44e4054.png)

Is this actually necessary?

cc @dilumaluthge

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [December 4, 2020, 12:54am UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231/2 "2020-12-04T00:54:08Z")

</div>

This is my understanding:

- If `push_preview` is `true`, pull request preview builds will be pushed, and builds on `master` will also be pushed  
If `push_preview` is `false`, pull request preview builds will NOT be pushed, but builds on `master` WILL still be pushed

It would be good to get clarification from @mortenpi

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [December 4, 2020, 12:57am UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231/3 "2020-12-04T00:57:41Z")

</div>

Or @fredrikekre

---

<div class="post-metadata">

### Author: ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)
#### Post date: [December 4, 2020, 1:58am UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231/4 "2020-12-04T01:58:16Z")

</div>

Yep, what @dilumaluthge says is true.

But I think the issue here is that you want to build the development version docs when you push to the `dev` branch, right? In this case, you should set [`devbranch = "dev"` in that case](https://juliadocs.github.io/Documenter.jl/stable/lib/public/#Documenter.deploydocs) – `deploydocs` by default assumes it is called `"master"`.

---

<div class="post-metadata">

### Author: ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)
#### Post date: [December 4, 2020, 5:44pm UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231/5 "2020-12-04T17:44:07Z")

</div>

If I understand correctly, we do NOT want to build the docs on pushes to the `dev` branch.

We DO want to build the docs on pushes to the `master` branch.

@ablaom Is that correct?

---

<div class="post-metadata">

### Author: ![ablaom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ablaom/32/4889_2.png) [@ablaom](https://discourse.julialang.org/u/ablaom)
#### Post date: [December 5, 2020, 2:46am UTC](https://discourse.julialang.org/t/using-documenter-jl-to-in-github-actions/51231/6 "2020-12-05T02:46:54Z")

</div>

Yes. Building docs for every PR slows things down, especially at MLJ.jl. So we have only generated docs for dev → master PRs

@dilumaluthge has worked out a solution to this for the ci.yml file and tested that indeed the make.jl file `deploy` command can drop the `push_preview=true` flag.

This ci.yml file can be viewed [here](https://github.com/alan-turing-institute/MLJBase.jl/blob/dev/.github/workflows/ci.yml), which is for workflows where most new PR’s are onto a dev branch and master is for tagged releases and doc-updates.

Many thanks to @dilumaluthge for this support and guiding us all through the travis → github/action transition 💟
