-
Notifications
You must be signed in to change notification settings - Fork 22
66 lines (58 loc) · 2.18 KB
/
pr-close.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Pull Request Close
on:
pull_request:
branches:
- master
types: [closed]
env:
PUBLISH_REPO: ${{ github.repository_owner }}/${{ github.repository_owner }}.github.io
PUBLISH_BRANCH: master
NEXTRA_PUBLISH_FOLDER: uikit-docs/pr-${{ github.event.number }}
STORYBOOK_PUBLISH_FOLDER: uikit/pr-${{ github.event.number }}
APP_PUBLISH_FOLDER: uikit-app/pr-${{ github.event.number }}
PUBLISH_MESSAGE: "chore: remove PR ${{ github.event.number }} of ${{ github.repository }}"
jobs:
cleanup-deployment:
name: Cleanup Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ env.PUBLISH_REPO }}
ref: ${{ env.PUBLISH_BRANCH }}
token: ${{ secrets.ORG_GHPAGES_DEPLOY_KEY }}
path: gh-docs
fetch-depth: 1
- name: Remove folder
run: |
cd ${{ github.workspace }}/gh-docs
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git rm -r --ignore-unmatch ${APP_PUBLISH_FOLDER}
git rm -r --ignore-unmatch ${NEXTRA_PUBLISH_FOLDER}
git rm -r --ignore-unmatch ${STORYBOOK_PUBLISH_FOLDER}
git commit -m "${PUBLISH_MESSAGE}"
git push
- name: Prune Deployment for Storybook Documentation
uses: bobheadxi/deployments@v1
with:
step: deactivate-env
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{env.STORYBOOK_PUBLISH_FOLDER}}
desc: Deployment for Stroybook documentation was pruned
- name: Prune Deployment for Nextra Documentation
if: ${{ false }}
uses: bobheadxi/deployments@v1
with:
step: deactivate-env
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{env.NEXTRA_PUBLISH_FOLDER}}
desc: Deployment for Nextra documentation was pruned
- name: Prune Deployment for App
uses: bobheadxi/deployments@v1
with:
step: deactivate-env
token: ${{ secrets.GITHUB_TOKEN }}
env: ${{env.APP_PUBLISH_FOLDER}}
desc: Deployment for app was pruned