From 3d58f98aae88e96ae1d91d990b4b6eb09ec3edc3 Mon Sep 17 00:00:00 2001 From: Takafumi Arakaki Date: Thu, 14 Apr 2022 21:44:19 -0700 Subject: [PATCH] Build documentation in CI (#5) --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++++- docs/make.jl | 31 ++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84ff636..76e9202 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,6 +70,30 @@ jobs: ) shell: julia --color=yes {0} + documenter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + - name: Install Run.jl + run: julia -e 'using Pkg; pkg"add Run@0.1"' + - name: Install dependencies + run: julia -e 'using Run; Run.prepare_docs()' + - name: Build and deploy + id: build-and-deploy + if: | + github.event_name == 'push' || ( + github.event_name == 'pull_request' && + !contains(github.head_ref, 'create-pull-request/') + ) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.SSH_KEY }} + run: julia -e 'using Run; Run.docs()' + - name: Just build + if: steps.build-and-deploy.outcome == 'skipped' + run: julia -e 'using Run; Run.docs()' + # https://github.com/tkf/julia-code-style-suggesters code-style: if: always() && github.event.pull_request @@ -80,7 +104,7 @@ jobs: # A job that succeeds if and only if all jobs succeed. all-success: if: always() && github.event.pull_request - needs: [test, aqua, code-style] + needs: [test, aqua, documenter, code-style] runs-on: ubuntu-latest steps: # https://github.com/tkf/merge-conclusions-action diff --git a/docs/make.jl b/docs/make.jl index b36841b..d94befd 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -4,12 +4,29 @@ using PreludeDicts makedocs( sitename = "PreludeDicts", format = Documenter.HTML(), - modules = [PreludeDicts] + modules = [PreludeDicts], + strict = [ + :autodocs_block, + :cross_references, + :docs_block, + :doctest, + :eval_block, + :example_block, + :footnote, + :linkcheck, + :meta_block, + # :missing_docs, + :parse_error, + :setup_block, + ], + # Ref: + # https://juliadocs.github.io/Documenter.jl/stable/lib/public/#Documenter.makedocs ) -# Documenter can also automatically deploy documentation to gh-pages. -# See "Hosting Documentation" and deploydocs() in the Documenter manual -# for more information. -#=deploydocs( - repo = "" -)=# +deploydocs( + repo = "github.com/JuliaPreludes/PreludeDicts.jl", + devbranch = "main", + push_preview = true, + # Ref: + # https://juliadocs.github.io/Documenter.jl/stable/lib/public/#Documenter.deploydocs +)