File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Cleanup Dev
2
+
3
+ on :
4
+ pull_request :
5
+ types : [closed]
6
+
7
+ jobs :
8
+ cleanup-ui-pr-preview :
9
+ permissions :
10
+ contents : read
11
+ id-token : ' write'
12
+ issues : write
13
+ runs-on : ubuntu-latest
14
+
15
+ steps :
16
+ - name : Create an empty directory for cleanup
17
+ run : mkdir -p empty
18
+
19
+ - name : Remove GitHub Pages Build
20
+ uses : peaceiris/actions-gh-pages@v3
21
+ with :
22
+ github_token : ${{ secrets.GITHUB_TOKEN }}
23
+ publish_dir : ./empty
24
+ destination_dir : ui/pr/${{ github.event.pull_request.number }}
25
+ keep_files : false
26
+ user_name : ${{ github.actor }}
27
+ user_email : ${{ github.actor }}@users.noreply.github.com
28
+ publish_branch : gh-pages
29
+ commit_message : ' chore: Clean up preview for PR #${{ github.event.pull_request.number }}'
30
+
31
+ - name : Log Cleanup Completion
32
+ run : echo "Cleanup completed for PR \#${{ github.event.pull_request.number }}"
33
+
34
+ update-preview-comment :
35
+ name : Update PR Comment
36
+ permissions :
37
+ pull-requests : write
38
+ issues : write
39
+ runs-on : ubuntu-latest
40
+ steps :
41
+ - name : Update PR comment to reflect cleanup
42
+ uses : peter-evans/create-or-update-comment@v3
43
+ with :
44
+ token : ${{ secrets.GITHUB_TOKEN }}
45
+ issue-number : ${{ github.event.pull_request.number }}
46
+ edit-mode : replace
47
+ body : |
48
+ <!-- pr-preview-comment -->
49
+ 🧹 The live preview for this PR has been removed.
Original file line number Diff line number Diff line change @@ -250,6 +250,7 @@ jobs:
250
250
user_name : ${{ github.actor }}
251
251
user_email : ${{ github.actor }}@users.noreply.github.com
252
252
publish_branch : gh-pages
253
+ commit_message : ' build: Deploy preview build for PR #${{ github.event.pull_request.number }}'
253
254
254
255
- name : Set deployment url
255
256
id : deploy
@@ -262,5 +263,7 @@ jobs:
262
263
with :
263
264
token : ${{ secrets.GITHUB_TOKEN }}
264
265
issue-number : ${{ github.event.pull_request.number }}
266
+ edit-mode : replace
265
267
body : |
268
+ <!-- pr-preview-comment -->
266
269
🎉 **Live Preview:** [Click here to view the live version](${{ steps.deploy.outputs.url }})
You can’t perform that action at this time.
0 commit comments