diff --git a/.github/workflows/DocCleanup.yml b/.github/workflows/DocCleanup.yml index 07ca4454..463a5f59 100644 --- a/.github/workflows/DocCleanup.yml +++ b/.github/workflows/DocCleanup.yml @@ -19,12 +19,12 @@ jobs: keep="$(readlink stable)" git config user.name "Documenter.jl" git config user.email "documenter@juliadocs.github.io" - git rm -rf --ignore-unmatch v[0-9]*.[0-9]* + git rm -rf --ignore-unmatch "v[0-9]*.[0-9]*" "previews/*" git checkout HEAD -- "$keep" if git diff --cached --quiet; then - echo "No old docs to delete" + echo "No old docs or previews to delete" else - git commit -m "Keep latest docs only" + git commit -m "Delete old docs and previews" 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/.github/workflows/DocPreviewCleanup.yml b/.github/workflows/DocPreviewCleanup.yml deleted file mode 100644 index a63156c6..00000000 --- a/.github/workflows/DocPreviewCleanup.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Doc Preview Cleanup -on: - pull_request: - types: [closed] -jobs: - doc-preview-cleanup: - runs-on: ubuntu-latest - steps: - - name: Checkout gh-pages branch - uses: actions/checkout@v7 - with: - ref: gh-pages - - name: Delete preview and history + push changes - run: | - if [ -d "previews/PR$PRNUM" ]; then - git config user.name "Documenter.jl" - git config user.email "documenter@juliadocs.github.io" - git rm -rf "previews/PR$PRNUM" - git commit -m "delete preview" - git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree}) - git push --force origin gh-pages-new:gh-pages - fi - env: - PRNUM: ${{ github.event.number }}