forked from Azure-Samples/github-actions-deployment-slots
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (30 loc) · 1004 Bytes
/
delete-pr-env.yaml
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
name: Delete PR env when PR is closed
on:
pull_request:
types: [closed]
concurrency:
group: ci-${{ github.event.number }}
cancel-in-progress: true
env:
WEBAPP_NAME: tomcat-app
RESOURCE_GROUP: freeberg-tomcat-slots-demo
SLOT_NAME: pr-${{ github.event.number }}
jobs:
delete-slot:
runs-on: ubuntu-latest
steps:
- name: Log into Azure CLI with service principal
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Delete slot on staging site
run: az webapp deployment slot delete --resource-group $RESOURCE_GROUP --name $WEBAPP_NAME --slot $SLOT_NAME
delete-deployment:
runs-on: ubuntu-latest
steps:
- name: Delete Deployment Environment
uses: strumwolf/[email protected]
with:
environment: "PR #${{ github.event.number }}"
token: ${{ secrets.GITHUB_TOKEN }}
onlyRemoveDeployments: true