From db49604a3d4885528eef423c8e2cfb0b2eb945fb Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:01:19 +0530 Subject: [PATCH 1/8] Update DocsNav.yml --- .github/workflows/DocsNav.yml | 52 ++++++++++++++--------------------- 1 file changed, 20 insertions(+), 32 deletions(-) diff --git a/.github/workflows/DocsNav.yml b/.github/workflows/DocsNav.yml index 14614d1..9efd327 100644 --- a/.github/workflows/DocsNav.yml +++ b/.github/workflows/DocsNav.yml @@ -1,49 +1,37 @@ -name: Add Navbar +name: Rebuild docs with newest navbar on: - page_build: # Triggers the workflow on push events to gh-pages branch - workflow_dispatch: # Allows manual triggering + # 3:25 AM UTC every Sunday -- choose an uncommon time to avoid + # periods of heavy GitHub Actions usage schedule: - - cron: '0 0 * * 0' # Runs every week on Sunday at midnight (UTC) + - cron: '25 3 * * 0' + # Whenever needed + workflow_dispatch: + +permissions: + contents: write jobs: - add-navbar: + update-navbar: runs-on: ubuntu-latest - permissions: - contents: write + steps: - - name: Checkout gh-pages + - name: Checkout gh-pages branch uses: actions/checkout@v4 with: ref: gh-pages - fetch-depth: 0 - - name: Download insert_navbar.sh - run: | - curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh - chmod +x insert_navbar.sh + - name: Insert navbar + uses: TuringLang/actions/DocsNav@main + with: + doc-path: '.' - - name: Update Navbar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Commit and push changes run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - - # Define the URL of the navbar to be used - NAVBAR_URL="https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/TuringNavbar.html" - - # Update all HTML files in the current directory (gh-pages root) - ./insert_navbar.sh . $NAVBAR_URL - - # Remove the insert_navbar.sh file - rm insert_navbar.sh - - # Check if there are any changes if [[ -n $(git status -s) ]]; then - git add . - git commit -m "Added navbar and removed insert_navbar.sh" - git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages + git add -A + git commit -m "Update navbar (automated)" + git push else echo "No changes to commit" fi From 9bb8bc42d029bf3a5ef899a7fb409995b1109a40 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:03:43 +0530 Subject: [PATCH 2/8] Remove Docs part from CI --- .github/workflows/CI.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 107d087..c8caacd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,20 +41,3 @@ jobs: coverage: "false" env: JULIA_NUM_THREADS: "auto" - docs: - name: Documentation - runs-on: ubuntu-latest - timeout-minutes: 40 - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: 1 - - uses: julia-actions/cache@v2 - - uses: julia-actions/julia-buildpkg@v1 - - run: julia --project=docs -e ' - using Pkg; Pkg.develop(path="."); - include("docs/make.jl")' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} From 0bebe547bf48c857d04b470ed1491a084b4eace1 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:05:22 +0530 Subject: [PATCH 3/8] Create Docs.yml --- .github/workflows/Docs.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/Docs.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 From b3185ecdfac6f0d9a32e92a1deb463f42a7ce7b4 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:06:51 +0530 Subject: [PATCH 4/8] No need of deploydocs() after using new Docs & DocsNav workflows --- docs/make.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index ed7926c..1c6113d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -38,7 +38,5 @@ makedocs(; linkcheck=true, ) -deploydocs(; repo="github.com/TuringLang/TuringGLM.jl", devbranch="main") - # Useful for local development. cd(pkgdir(TuringGLM)) From 8f58f845275a7afbf87ce4906cc91932192f3548 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 15:10:13 +0530 Subject: [PATCH 5/8] Added timeout-minutes --- .github/workflows/Docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index 0db924a..a31a682 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -22,6 +22,7 @@ permissions: jobs: docs: runs-on: ubuntu-latest + timeout-minutes: 40 steps: - name: Build and deploy Documenter.jl docs From 93fb332b29b10ac6c2627e167774ceae09c9c605 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:26:26 +0530 Subject: [PATCH 6/8] Update DocsNav.yml --- .github/workflows/DocsNav.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/DocsNav.yml b/.github/workflows/DocsNav.yml index 9efd327..7e86195 100644 --- a/.github/workflows/DocsNav.yml +++ b/.github/workflows/DocsNav.yml @@ -29,6 +29,8 @@ jobs: - name: Commit and push changes run: | if [[ -n $(git status -s) ]]; then + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com git add -A git commit -m "Update navbar (automated)" git push From 6319876d40286167c46bb254f32d94ba7e514976 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:26:47 +0530 Subject: [PATCH 7/8] Update Docs.yml --- .github/workflows/Docs.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml index a31a682..d475788 100644 --- a/.github/workflows/Docs.yml +++ b/.github/workflows/Docs.yml @@ -6,8 +6,6 @@ on: - main tags: '*' pull_request: - merge_group: - types: [checks_requested] concurrency: # Skip intermediate builds: always. From 540957dfb229e66ef8a979c20e67e10d1973328b Mon Sep 17 00:00:00 2001 From: Rik Huijzer Date: Sun, 9 Feb 2025 18:34:38 +0100 Subject: [PATCH 8/8] Update .github/workflows/DocsNav.yml --- .github/workflows/DocsNav.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DocsNav.yml b/.github/workflows/DocsNav.yml index 7e86195..e68791d 100644 --- a/.github/workflows/DocsNav.yml +++ b/.github/workflows/DocsNav.yml @@ -4,7 +4,7 @@ on: # 3:25 AM UTC every Sunday -- choose an uncommon time to avoid # periods of heavy GitHub Actions usage schedule: - - cron: '25 3 * * 0' + - cron: '25 3 * * 0' # At 03:25 on Sunday. # Whenever needed workflow_dispatch: