elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Automate docs publishing to Hexdocs with GitHub Actions

Open josevalim opened this issue 3 years ago • 7 comments

Currently it is done by Bob. We want to publish docs automatically for:

  1. main
  2. each v*.* branch (without the v prefix)
  3. each tag

josevalim avatar Aug 02 '22 07:08 josevalim

Hi @wingyplus, after discussing with @wojtekmach, we decided that we should publish nightly builds to S3, as that should be much easier. With that said, here is a proposal:

  1. Let's start with this issue by publishing docs for main and v*.* branches. Note that we should publish the docs even if tests fail. This will allow us to setup S3.

  2. Then let's start publishing docs for tags, it should be an addition on top of our release process.

  3. Finally, we add start publishing nightly builds to S3, by extending the code implemented on step 1.

WDYT? Are you interested in tackling it?

josevalim avatar Aug 02 '22 15:08 josevalim

That sounds interesting. Let me check in details in ~4 hours (9 PM in my time). 🙇

wingyplus avatar Aug 03 '22 10:08 wingyplus

For 1, I think it could be done by using build matrix. But how many versions do we need to publish? And I'm not sure about building docs for elixir version < 1.10 (This is the first version that I start using). I think we can start by building doc on main branch to see how its work and apply it more.

For 2, I think it's not hard.

For 3, Do we still need to publish on GitHub Release? And do we need to publish builds when tag was created?

wingyplus avatar Aug 03 '22 14:08 wingyplus

The documentation we will always generate for the last OTP version, only on Linux. I think we can allow on all branches because it is extremely unlikely I commit will be made to any branch besides 1.13 and 1.14. :)

for 3, we will push only to S3. Tags we will push to both GitHub (as we do today) and S3

josevalim avatar Aug 03 '22 15:08 josevalim

Thank you for your information. I’ll take a look tomorrow. 🙇‍♂️

wingyplus avatar Aug 03 '22 16:08 wingyplus

@josevalim To ExDoc or to HexDocs?

eksperimental avatar Aug 06 '22 12:08 eksperimental

Fixed, thank you!

josevalim avatar Aug 06 '22 13:08 josevalim

Hi @gilacost! So what is left now is to: push the Precompiled.zip to S3 as well (as Hex Bob does) and enable this for tags too!

josevalim avatar Nov 12 '22 08:11 josevalim

Hey @josevalim, bob's build elixir_job, runs elixir.sh. This script does five things:

  • builds elixir with make compile, we are already handling this in the composite action with make Precompile.zip
  • uploads docs
  • uploads_build
  • uploads builds_txt
  • purges fastly

I've just submitted a PR that tackles this, we can refactor later, it is already mentioned in the PR description. Also I added @wingyplus as co-author for all commits in the PR ❤️ 🚀

gilacost avatar Nov 15 '22 19:11 gilacost