-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.36 KB
/
cleanup-previews.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
38
39
40
41
42
43
44
45
46
name: Cleanup preview repository
on:
pull_request:
types:
- closed
env:
TARGET_DOCS_PATH: "/docs/${{ github.event.pull_request.head.ref }}"
TARGET_STORYBOOK_PATH: "/storybook/${{ github.event.pull_request.head.ref }}"
jobs:
cleanup_previews:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
PUBLISH_PAT: ${{ secrets.PUBLISH_PAT }}
steps:
- name: Cleanup docs directory 🧹
uses: maaaathis/delete-remote-directory@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUBLISH_PAT }}
with:
target-github-username: mittwald
target-repository-name: flow-previews
target-branch: main
target-directory: "${{ env.TARGET_DOCS_PATH }}"
commit-message: "Cleanup merged docs previews"
- name: Cleanup storybook directory 🧹
uses: maaaathis/delete-remote-directory@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUBLISH_PAT }}
with:
target-github-username: mittwald
target-repository-name: flow-previews
target-branch: main
target-directory: "${{ env.TARGET_STORYBOOK_PATH }}"
commit-message: "Cleanup merged Storybook previews"
- name: Summary
run: |
echo Deleted Documentation and Storybook for branch: ${{ github.event.pull_request.head.ref }}