diff --git a/.github/workflows/delete-preview.yaml b/.github/workflows/delete-preview.yaml new file mode 100644 index 0000000..9674446 --- /dev/null +++ b/.github/workflows/delete-preview.yaml @@ -0,0 +1,24 @@ +name: delete-preview + +on: + workflow_call: + +jobs: + delete: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + steps: + - name: Checkout gh-pages branch + uses: actions/checkout@v3 + with: + ref: gh-pages + - name: Delete preview files + run: | + rm -rf _preview/${{ github.event.pull_request.number }} + - name: Commit the changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: gh-pages + commit_message: Delete preview for pull request \#${{ github.event.pull_request.number }} \ No newline at end of file