reusable github workflows, fixes for permissions and dependabot issues #37
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Delete PR website | |
on: | |
pull_request: | |
types: [closed] | |
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 }} | |