From 0fa955660e0133f6b0b25363720b21311e108ef7 Mon Sep 17 00:00:00 2001 From: Mateus Date: Wed, 25 Sep 2024 17:12:45 -0300 Subject: [PATCH] mk/ testing doc cleanup --- .github/workflows/doc_cleanup.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/doc_cleanup.yml diff --git a/.github/workflows/doc_cleanup.yml b/.github/workflows/doc_cleanup.yml new file mode 100644 index 0000000..22d9043 --- /dev/null +++ b/.github/workflows/doc_cleanup.yml @@ -0,0 +1,26 @@ +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@v2 + 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 }} \ No newline at end of file