From 52a5154f7a990a9d158a5cf3f1da976407310048 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Tue, 12 Jan 2021 17:59:20 +0100 Subject: [PATCH 1/3] Create doc_preview_cleanup.yml --- .github/workflows/doc_preview_cleanup.yml | 28 +++++++++++++++++++++++ 1 file changed, 28 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 000000000..156802415 --- /dev/null +++ b/.github/workflows/doc_preview_cleanup.yml @@ -0,0 +1,28 @@ +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 + run: | + 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}) + env: + PRNUM: ${{ github.event.number }} + + - name: Push changes + run: | + git push --force origin gh-pages-new:gh-pages From 78c78bfb5085792fb8d4f231b2830268c99da2c8 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Tue, 12 Jan 2021 18:03:29 +0100 Subject: [PATCH 2/3] Update Documentation.yml --- .github/workflows/Documentation.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 7017e7e46..2c45dd9b9 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -3,8 +3,9 @@ name: Documentation on: push: branches: - - 'master' + - master tags: '*' + pull_request: workflow_dispatch: schedule: # Run on the 23rd hour every day @@ -44,4 +45,4 @@ jobs: julia --project=docs --color=yes make.jl $(git -C ~/.julia/dev/Turing tag --sort version:refname | tail -n 1) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} \ No newline at end of file + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} From 322b4acb5f9851100952f70b65c5e0fa7a833394 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Tue, 12 Jan 2021 18:06:42 +0100 Subject: [PATCH 3/3] Update make.jl --- make.jl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/make.jl b/make.jl index f590fbee9..3b6206c6e 100644 --- a/make.jl +++ b/make.jl @@ -99,22 +99,17 @@ with_baseurl(() -> run(`$new_jekyll_build`), baseurl, joinpath(local_path, "_con # Copy assets to folder cp(joinpath(tmp_path, "assets"), joinpath(tmp_path, "_site", "assets"), force=true) -repo = "github.com:TuringLang/turing.ml.git" - deploy_config = GitHubActions( "TuringLang/turing.ml", #github_repository::String "push", #github_event_name::String is_dev ? "refs/heads/master" : "refs/tags/$(ARGS[1])" #github_ref::String ) -deploydocs( +deploydocs(; + repo = "github.com:TuringLang/turing.ml.git", target = joinpath(tmp_path, "_site"), - repo = repo, - branch = "gh-pages", - devbranch = "master", - devurl = "dev", - versions = ["stable" => "v^", "v#.#", "dev" => "dev"], - deploy_config = deploy_config + deploy_config = deploy_config, + push_preview = true, ) @info "" get(ENV, "GITHUB_REF", missing)