diff --git a/.github/workflows/hugo.yaml b/.github/workflows/hugo.yaml index 8eeec3dc..d3376e5e 100644 --- a/.github/workflows/hugo.yaml +++ b/.github/workflows/hugo.yaml @@ -61,9 +61,19 @@ jobs: force: false - name: Deploy PR Preview - if: github.event_name == 'pull_request' + if: github.event_name == 'pull_request' && github.event.action != 'closed' uses: rossjrw/pr-preview-action@v1 with: source-dir: public preview-branch: gh-pages umbrella-dir: pr-preview + action: deploy + + - name: Remove PR Preview + if: github.event_name == 'pull_request' && github.event.action == 'closed' + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: . + preview-branch: gh-pages + umbrella-dir: pr-preview + action: remove