-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.1 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
name: Delete PR website
on:
pull_request:
types: [closed]
permissions:
id-token: write
contents: read
jobs:
delete:
name: delete created website
runs-on: ubuntu-20.04
env:
domain_name: ${{ format('pr-{0}.preview.khaledez.net', github.event.pull_request.number) }}
cert_domain: "*.preview.khaledez.net"
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: aws-actions/configure-aws-credentials@v3
with:
audience: sts.amazonaws.com
role-to-assume: arn:aws:iam::427368570714:role/net.khaledez.www-github-actions
aws-region: eu-west-2 # London
- uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.5.x
- name: Setup configuration
run: |
echo 'env_name=dev' > please.env
echo 'domain_name=${{ env.domain_name }}' >> please.env
- name: Terraform init
run: sh ./please init
- name: destroy resources
run: |
sh ./please destroy
env:
TF_VAR_cert_domain: ${{ env.cert_domain }}