From 74947fb2470ba0d24de0cd4ddf088fb9192f04e3 Mon Sep 17 00:00:00 2001 From: odow Date: Thu, 21 Sep 2023 09:02:48 +1200 Subject: [PATCH 1/4] Update documentation build script --- .github/workflows/documentation.yml | 6 +++--- docs/Project.toml | 4 ++++ docs/make.jl | 29 ++++++++++++++++++----------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 7907e460..e53ed7e7 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -11,14 +11,14 @@ jobs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest with: version: '1' - name: Install Dependencies - run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + run: julia --project=docs --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and Deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: julia --project=docs docs/make.jl + run: julia --project=docs --color=yes docs/make.jl diff --git a/docs/Project.toml b/docs/Project.toml index dfa65cd1..30133efa 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,2 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +WaterModels = "7c60b362-08f4-5b14-8680-cd67a3e18348" + +[compat] +Documenter = "1" diff --git a/docs/make.jl b/docs/make.jl index 6ef3c64b..dca14486 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,17 +1,21 @@ -using Documenter, WaterModels +import Documenter +import WaterModels -makedocs( - modules = [WaterModels], - format = Documenter.HTML(analytics="UA-367975-10", mathengine=Documenter.MathJax(), prettyurls=false), +Documenter.makedocs( sitename = "WaterModels", authors = "Byron Tasseff and contributors", + format = Documenter.HTML( + analytics="UA-367975-10", + mathengine = Documenter.MathJax(), + prettyurls = false, + ), pages = [ "Home" => "index.md", "Manual" => [ "Getting Started" => "quickguide.md", "Network Data Format" => "network-data.md", "Result Data Format" => "result-data.md", - "Mathematical Models" => "math-model.md" + "Mathematical Models" => "math-model.md", ], "Library" => [ "Network Formulations" => "formulations.md", @@ -19,16 +23,19 @@ makedocs( "Modeling Components" => [ "Objective" => "objective.md", "Variables" => "variables.md", - "Constraints" => "constraints.md" + "Constraints" => "constraints.md", ], - "File I/O" => "parser.md" + "File I/O" => "parser.md", ], - "Developer" => "developer.md", - "Examples" => "examples.md" + "Devegloper" => "developer.md", + "Examples" => "examples.md", ], - warnonly = true + clean = true, + modules = [WaterModels], + warnonly = true, ) -deploydocs( +Documenter.deploydocs( repo = "github.com/lanl-ansi/WaterModels.jl.git", + push_preview = true, ) From c2d22e68b06da6376a816d40b95202e8b42fcb95 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 21 Sep 2023 10:53:09 +1200 Subject: [PATCH 2/4] Create doc_cleanup.yml --- .github/workflows/doc_cleanup.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/doc_cleanup.yml diff --git a/.github/workflows/doc_cleanup.yml b/.github/workflows/doc_cleanup.yml new file mode 100644 index 00000000..182f2842 --- /dev/null +++ b/.github/workflows/doc_cleanup.yml @@ -0,0 +1,24 @@ +name: Doc Preview Cleanup +on: + pull_request: + types: [closed] +jobs: + doc-preview-cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v3 + with: + ref: gh-pages + - name: Delete preview and history + push changes + run: | + if [ -d "previews/PR$PRNUM" ]; then + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf "previews/PR$PRNUM" + git commit -m "delete preview" + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi + env: + PRNUM: ${{ github.event.number }} From c822c20de9e36bb0f262d6310c560e5ecb259c17 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 21 Sep 2023 13:54:22 +1200 Subject: [PATCH 3/4] Update docs/make.jl --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index dca14486..44184f93 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -27,7 +27,7 @@ Documenter.makedocs( ], "File I/O" => "parser.md", ], - "Devegloper" => "developer.md", + "Developer" => "developer.md", "Examples" => "examples.md", ], clean = true, From a3dc74afc84d6bdad821a2042bc07a5e80e1a5da Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Thu, 21 Sep 2023 13:54:44 +1200 Subject: [PATCH 4/4] Update docs/make.jl --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 44184f93..72ba98c2 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -5,7 +5,7 @@ Documenter.makedocs( sitename = "WaterModels", authors = "Byron Tasseff and contributors", format = Documenter.HTML( - analytics="UA-367975-10", + analytics = "UA-367975-10", mathengine = Documenter.MathJax(), prettyurls = false, ),