This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: delete preview on PR close | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
delete_preview: | |
runs-on: ubuntu-latest | |
env: | |
PR_PATH: pull/${{github.event.number}} | |
steps: | |
- name: make empty dir | |
run: mkdir out | |
- name: delete folder | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./out | |
destination_dir: ${{ env.PR_PATH }} | |
cname: wiki.watonomous.ca | |
- name: Comment on PR | |
uses: hasura/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
number: ${{ github.event.number }} | |
id: deploy-preview | |
message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/" |