From a3d63fb3e172c3f40a4ec7df04bebc6926b4be8b Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:00:56 +0530 Subject: [PATCH 1/4] Update and rename documentation.yml to Docs.yml --- .github/workflows/Docs.yml | 28 +++++++++++++++++++++++++++ .github/workflows/documentation.yml | 30 ----------------------------- 2 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/Docs.yml delete mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml new file mode 100644 index 0000000..0db924a --- /dev/null +++ b/.github/workflows/Docs.yml @@ -0,0 +1,28 @@ +name: Documentation + +on: + push: + branches: + - main + 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/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 - From d3a7c575d52d8b5ce536a39eec530985f9a45496 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:03:03 +0530 Subject: [PATCH 2/4] Create DocsNav.yml --- .github/workflows/DocsNav.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/DocsNav.yml 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 From 343aa4512258b218e586a135d373e171817def27 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:04:04 +0530 Subject: [PATCH 3/4] No need of deploydocs() after using new Docs & DocsNav workflows --- docs/make.jl | 5 ----- 1 file changed, 5 deletions(-) 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 -) From 48b3980b899ca09554ecd8fb9cdcc5fe9ca6dfec Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:06:22 +0530 Subject: [PATCH 4/4] branch name fix --- .github/workflows/Docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index 0db924a..2d874e9 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -3,7 +3,7 @@ name: Documentation on: push: branches: - - main + - master tags: '*' pull_request: merge_group: