-
Notifications
You must be signed in to change notification settings - Fork 15
37 lines (32 loc) · 1.07 KB
/
preview-cleanup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Delete preview on PR close
on:
pull_request:
types: [closed]
jobs:
delete_preview:
runs-on: ubuntu-20.04
env:
PR_PATH: ${{ github.event.repository.name }}/pull/${{github.event.number}}
DOMAIN: gradle.github.io
PREVIEW_REPO: community-site-preview
permissions:
pull-requests: write
steps:
- name: make empty dir
run: mkdir public
- name: delete folder
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.PREVIEW_DEPLOYMENT_KEY }}
external_repository: gradle/${{ env.PREVIEW_REPO }}
publish_dir: ./public
destination_dir: ${{ env.PR_PATH }}
- 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/${{ env.PREVIEW_REPO }}/tree/gh-pages/${{ env.PR_PATH }}/