Skip to content

Preview of documentation #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Documentation
on:
push:
branches:
- 'master'
- master
tags: '*'
pull_request:
workflow_dispatch:
schedule:
# Run on the 23rd hour every day
Expand Down Expand Up @@ -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 }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
28 changes: 28 additions & 0 deletions .github/workflows/doc_preview_cleanup.yml
Original file line number Diff line number Diff line change
@@ -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
13 changes: 4 additions & 9 deletions make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)