From 6d42b908d7716e09fdc0d57fc4e6094ba88065f3 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Fri, 21 Jun 2024 18:45:51 +0530 Subject: [PATCH 1/4] Update make.jl for adding Navigation bar --- docs/make.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/make.jl b/docs/make.jl index 9395d2a0..f7d44c0a 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,4 +12,7 @@ makedocs(; checkdocs=:exports, ) +# Insert navbar in each html file +run(`sh -c "curl -s https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh | bash -s docs/build"`) + deploydocs(; repo="github.com/TuringLang/AbstractMCMC.jl.git", push_preview=true) From ae2ecd520130c1abd30596398bf45bfee91aa130 Mon Sep 17 00:00:00 2001 From: Hong Ge <3279477+yebai@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:25:48 +0100 Subject: [PATCH 2/4] Update docs/make.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- docs/make.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index f7d44c0a..5faf7e47 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -13,6 +13,8 @@ makedocs(; ) # Insert navbar in each html file -run(`sh -c "curl -s https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh | bash -s docs/build"`) +run( + `sh -c "curl -s https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh | bash -s docs/build"`, +) deploydocs(; repo="github.com/TuringLang/AbstractMCMC.jl.git", push_preview=true) From 3d0a6e334bd4c19518f9d719d5f280a948de28a6 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Fri, 21 Jun 2024 19:03:46 +0000 Subject: [PATCH 3/4] added navigations bar workflow --- .github/workflows/DocsNav.yml | 45 +++++++++++++++++++++++++++++++++++ docs/make.jl | 5 ---- 2 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/DocsNav.yml diff --git a/.github/workflows/DocsNav.yml b/.github/workflows/DocsNav.yml new file mode 100644 index 00000000..a8c5cee2 --- /dev/null +++ b/.github/workflows/DocsNav.yml @@ -0,0 +1,45 @@ +name: Add Navbar + +on: + workflow_run: + workflows: ["*"] # add workflow names that generates docs in this list like `workflows: ["Docs Workflow", "Previews Workflow]` + types: + - completed + workflow_dispatch: # Allows manual triggering + +jobs: + add-navbar: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + permissions: + contents: write + steps: + - name: Checkout gh-pages + 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: Update Navbar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + + # Update all HTML files in the current directory (gh-pages root) + ./insert_navbar.sh . + + # Check if there are any changes + if [[ -n $(git status -s) ]]; then + git add . + git commit -m "added navbar" + git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages + else + echo "No changes to commit" + fi \ No newline at end of file diff --git a/docs/make.jl b/docs/make.jl index 5faf7e47..9395d2a0 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -12,9 +12,4 @@ makedocs(; checkdocs=:exports, ) -# Insert navbar in each html file -run( - `sh -c "curl -s https://raw.githubusercontent.com/TuringLang/turinglang.github.io/main/assets/scripts/insert_navbar.sh | bash -s docs/build"`, -) - deploydocs(; repo="github.com/TuringLang/AbstractMCMC.jl.git", push_preview=true) From 9ee53676cfc66965f5e896c39544b65b55a9e967 Mon Sep 17 00:00:00 2001 From: Shravan Goswami <123811742+shravanngoswamii@users.noreply.github.com> Date: Mon, 24 Jun 2024 14:36:16 +0000 Subject: [PATCH 4/4] updated workflow --- .github/workflows/DocsNav.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/DocsNav.yml b/.github/workflows/DocsNav.yml index a8c5cee2..3a91f0ad 100644 --- a/.github/workflows/DocsNav.yml +++ b/.github/workflows/DocsNav.yml @@ -2,8 +2,8 @@ name: Add Navbar on: workflow_run: - workflows: ["*"] # add workflow names that generates docs in this list like `workflows: ["Docs Workflow", "Previews Workflow]` - types: + workflows: ["Documentation"] # add workflow names that generates docs in this list like `workflows: ["Docs Workflow", "Previews Workflow]` + types: - completed workflow_dispatch: # Allows manual triggering @@ -31,14 +31,17 @@ jobs: run: | git config user.name github-actions[bot] git config user.email github-actions[bot]@users.noreply.github.com - + # Update all HTML files in the current directory (gh-pages root) ./insert_navbar.sh . - + + # 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" + git commit -m "Added navbar and removed insert_navbar.sh" git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" gh-pages else echo "No changes to commit"