From f70bddd46a744b04bd251e97ee8829010666e6e7 Mon Sep 17 00:00:00 2001 From: Matthew Ware Date: Sun, 20 Feb 2022 12:53:50 -0500 Subject: [PATCH 1/5] Starting docs build --- docs/Project.toml | 5 +++++ docs/make.jl | 11 +++++++++++ docs/src/index.md | 29 +++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 docs/Project.toml create mode 100644 docs/make.jl create mode 100644 docs/src/index.md diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..1bc937b --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "0.26, 0.27" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..fc71a06 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,11 @@ +using Documenter, RandomQuantum + +makedocs( + sitename = "RandomQuantum", + modules = [RandomQuantum], + format = Documenter.HTML(; prettyurls = get(ENV, "CI", nothing) == "true"), + pages = [ + "index.md" + ] +) + diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..575d5df --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,29 @@ +# RandomQuantum Documentation + +```@content +``` + +## Functions + +More info to come + +## Data Structs + +```@docs +GinibreEnsemble +FubiniStudyPureState +FubiniStudyMixedState +HilbertSchmidtMixedState +BuresMixedState +ClosedHaarEnsemble +OpenHaarEnsemble +GUE +RandomClosedEvolution +RandomOpenEvolution +``` + +## Index + +```@index +``` + From a093a8fc7a7ed1b6e4911ac0ffdedfa3eced2fab Mon Sep 17 00:00:00 2001 From: Matthew Ware Date: Sun, 20 Feb 2022 13:12:40 -0500 Subject: [PATCH 2/5] Skeleton for building and hosting docs --- .github/workflows/documentation.yml | 23 +++++++++++++++++++++++ docs/make.jl | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..382a0c2 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,23 @@ +name: Documentation + +on: + push: + branches: + - master + tags: '*' + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest + with: + version: '1.6' + - name: Install dependencies + run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + - name: Build and deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token + run: julia --color=yes --project=docs/ docs/make.jl diff --git a/docs/make.jl b/docs/make.jl index fc71a06..ee917f7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -9,3 +9,8 @@ makedocs( ] ) +deploydocs(; + repo = "github.com/BBN-Q/RandomQuantum.jl.git", + push_preview=true, +) + From 23d8c7fb21eb4bcb9eb512dd77600999518bf4e4 Mon Sep 17 00:00:00 2001 From: Matthew Ware Date: Sun, 20 Feb 2022 13:53:24 -0500 Subject: [PATCH 3/5] Remove preview --- docs/make.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index ee917f7..9e2dc41 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -10,7 +10,7 @@ makedocs( ) deploydocs(; - repo = "github.com/BBN-Q/RandomQuantum.jl.git", - push_preview=true, + repo = "github.com/BBN-Q/RandomQuantum.jl.git", + push_preview = false ) From 630f0f7b4d2578de61dc40baf26701c40ffcc5bf Mon Sep 17 00:00:00 2001 From: Matthew Ware Date: Sun, 20 Feb 2022 13:58:36 -0500 Subject: [PATCH 4/5] Add previews again --- docs/make.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 9e2dc41..a7f814c 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -11,6 +11,6 @@ makedocs( deploydocs(; repo = "github.com/BBN-Q/RandomQuantum.jl.git", - push_preview = false + push_preview = true ) From 2f1bfb24ffa2d4f8c034592caeeadc5fd952887f Mon Sep 17 00:00:00 2001 From: Matthew Ware Date: Sun, 20 Feb 2022 14:03:46 -0500 Subject: [PATCH 5/5] Add preview cleanup for stale documentation --- .github/workflows/doc_preview_cleanup.yml | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/doc_preview_cleanup.yml diff --git a/.github/workflows/doc_preview_cleanup.yml b/.github/workflows/doc_preview_cleanup.yml new file mode 100644 index 0000000..bc29462 --- /dev/null +++ b/.github/workflows/doc_preview_cleanup.yml @@ -0,0 +1,26 @@ +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@v2 + 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 }}