diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml new file mode 100644 index 0000000..2d874e9 --- /dev/null +++ b/.github/workflows/Docs.yml @@ -0,0 +1,28 @@ +name: Documentation + +on: + push: + branches: + - master + tags: '*' + pull_request: + merge_group: + types: [checks_requested] + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +permissions: + contents: write + pull-requests: read + +jobs: + docs: + runs-on: ubuntu-latest + + steps: + - name: Build and deploy Documenter.jl docs + uses: TuringLang/actions/DocsDocumenter@main diff --git a/.github/workflows/DocsNav.yml b/.github/workflows/DocsNav.yml new file mode 100644 index 0000000..9efd327 --- /dev/null +++ b/.github/workflows/DocsNav.yml @@ -0,0 +1,37 @@ +name: Rebuild docs with newest navbar + +on: + # 3:25 AM UTC every Sunday -- choose an uncommon time to avoid + # periods of heavy GitHub Actions usage + schedule: + - cron: '25 3 * * 0' + # Whenever needed + workflow_dispatch: + +permissions: + contents: write + +jobs: + update-navbar: + runs-on: ubuntu-latest + + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v4 + with: + ref: gh-pages + + - name: Insert navbar + uses: TuringLang/actions/DocsNav@main + with: + doc-path: '.' + + - name: Commit and push changes + run: | + if [[ -n $(git status -s) ]]; then + git add -A + git commit -m "Update navbar (automated)" + git push + else + echo "No changes to commit" + fi diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml deleted file mode 100644 index 904ab71..0000000 --- a/.github/workflows/documentation.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Documentation - -on: - push: - branches: - - master - tags: '*' - pull_request: - -jobs: - build: - permissions: - contents: write - statuses: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: julia-actions/setup-julia@v1 - with: - version: 1 - - 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 }} - run: julia --project=docs/ docs/make.jl - diff --git a/docs/make.jl b/docs/make.jl index a830a7c..4d72c30 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -6,8 +6,3 @@ using AdvancedMH # cp(joinpath(@__DIR__, "../README.md"), joinpath(@__DIR__, "src/index.md")) makedocs(sitename = "AdvancedMH", format = Documenter.HTML(), modules = [AdvancedMH], checkdocs = :exports) - -deploydocs( - repo = "github.com/TuringLang/AdvancedMH.jl.git", - push_preview = true, # allow PR to deploy -)