Skip to content

Commit

Permalink
Build documentation in CI (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf authored Apr 15, 2022
1 parent 3a5f978 commit 3d58f98
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 8 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
31 changes: 24 additions & 7 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<repository url>"
)=#
deploydocs(
repo = "github.com/JuliaPreludes/PreludeDicts.jl",
devbranch = "main",
push_preview = true,
# Ref:
# https://juliadocs.github.io/Documenter.jl/stable/lib/public/#Documenter.deploydocs
)

0 comments on commit 3d58f98

Please sign in to comment.