forked from dockersamples/example-voting-app
-
Notifications
You must be signed in to change notification settings - Fork 11
34 lines (32 loc) · 1.12 KB
/
delete-preview.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
name: Delete Uffizzi Preview
on:
pull_request:
types:
- closed
jobs:
delete-preview:
name: Delete Uffizzi Preview
runs-on: ubuntu-latest
steps:
- name: Find comment for deployment URL
uses: peter-evans/find-comment@v2
id: find-comment
if: github.event_name == 'pull_request'
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Uffizzi Preview deployed
- name: Output deployment ID
id: preview
# voodoo
run: 'echo ''${{ steps.find-comment.outputs.comment-body }}'' | sed -n "s/Uffizzi Preview ID: \`\(\S*\)\`/::set-output name=id::\1/p"'
- name: DEBUG - Echo deployment ID
run: 'echo ${{ steps.preview.outputs.id }}'
- name: Delete Preview from Uffizzi
uses: UffizziCloud/delete-preview-action@main
with:
id: ${{ steps.preview.outputs.id }}
username: [email protected]
server: https://temp-2022-04.uffizzicloud.com/
project: default
password: ${{ secrets.UFFIZZI_PASSWORD }}