From eee9c62655ca67aefbff4c05e9ec3eb0cd568f2c Mon Sep 17 00:00:00 2001 From: Elias Carvalho Date: Tue, 23 Jun 2026 09:06:29 -0300 Subject: [PATCH 1/4] Add Doc Cleanup action & Show only latest docs --- .github/workflows/DocCleanup.yml | 24 ++++++++++++++++++++++++ docs/make.jl | 7 ++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/DocCleanup.yml diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml new file mode 100644 index 00000000..1add954b --- /dev/null +++ b/.github/workflows/DocCleanup.yml @@ -0,0 +1,24 @@ +name: Doc Cleanup +on: + # runs on the 1st day of every month at 03:00 UTC + schedule: + - cron: '0 3 1 * *' + workflow_dispatch: +jobs: + doc-cleanup: + runs-on: ubuntu-latest + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v7 + with: + ref: gh-pages + - name: Delete old docs + run: | + keep=$(readlink stable) + git config user.name "Documenter.jl" + git config user.email "documenter@juliadocs.github.io" + git rm -rf v[0-9]*.[0-9]* && git checkout HEAD -- $keep + if git commit -m "keep latest docs only" ; then + git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) + git push --force origin gh-pages-new:gh-pages + fi diff --git a/docs/make.jl b/docs/make.jl index 75c69056..83a22a2e 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -21,4 +21,9 @@ makedocs(; ] ) -deploydocs(; repo="github.com/JuliaML/TableTransforms.jl", devbranch="master", push_preview=true) +deploydocs(; + repo="github.com/JuliaML/TableTransforms.jl", + versions=["stable" => "v^", "dev" => "dev"], + devbranch="master", + push_preview=true +) From e035c1bd9a15b89dcf5e92074f42d10b09bb057f Mon Sep 17 00:00:00 2001 From: Elias Carvalho <73039601+eliascarv@users.noreply.github.com> Date: Tue, 23 Jun 2026 09:30:52 -0300 Subject: [PATCH 2/4] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/DocCleanup.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml index 1add954b..deb3d8c1 100644 --- a/.github/workflows/DocCleanup.yml +++ b/.github/workflows/DocCleanup.yml @@ -4,6 +4,8 @@ on: schedule: - cron: '0 3 1 * *' workflow_dispatch: +permissions: + contents: write jobs: doc-cleanup: runs-on: ubuntu-latest @@ -14,10 +16,11 @@ jobs: ref: gh-pages - name: Delete old docs run: | - keep=$(readlink stable) + keep="$(readlink stable)" git config user.name "Documenter.jl" git config user.email "documenter@juliadocs.github.io" - git rm -rf v[0-9]*.[0-9]* && git checkout HEAD -- $keep + git rm -rf --ignore-unmatch v[0-9]*.[0-9]* + git checkout HEAD -- "$keep" if git commit -m "keep latest docs only" ; then git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) git push --force origin gh-pages-new:gh-pages From a9f4f21fb6c9d1f8a31bf84be12a77740325b932 Mon Sep 17 00:00:00 2001 From: Elias Carvalho <73039601+eliascarv@users.noreply.github.com> Date: Tue, 23 Jun 2026 09:35:40 -0300 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/DocCleanup.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml index deb3d8c1..4f67e41a 100644 --- a/.github/workflows/DocCleanup.yml +++ b/.github/workflows/DocCleanup.yml @@ -21,7 +21,10 @@ jobs: git config user.email "documenter@juliadocs.github.io" git rm -rf --ignore-unmatch v[0-9]*.[0-9]* git checkout HEAD -- "$keep" - if git commit -m "keep latest docs only" ; then + if git diff --cached --quiet; then + echo "No old docs to delete." + else + git commit -m "keep latest docs only" git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) git push --force origin gh-pages-new:gh-pages fi From cea597d283d71a824ff05e61ddac44f23097e4ab Mon Sep 17 00:00:00 2001 From: Elias Carvalho Date: Tue, 23 Jun 2026 09:38:18 -0300 Subject: [PATCH 4/4] Update messages --- .github/workflows/DocCleanup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml index 4f67e41a..07ca4454 100644 --- a/.github/workflows/DocCleanup.yml +++ b/.github/workflows/DocCleanup.yml @@ -22,9 +22,9 @@ jobs: git rm -rf --ignore-unmatch v[0-9]*.[0-9]* git checkout HEAD -- "$keep" if git diff --cached --quiet; then - echo "No old docs to delete." + echo "No old docs to delete" else - git commit -m "keep latest docs only" + git commit -m "Keep latest docs only" git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) git push --force origin gh-pages-new:gh-pages fi