Destroy state and delete workspace after deleting branch #2
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: Destroy state and delete workspace after deleting branch | |
on: [delete] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Grant Permission | |
run: | | |
chmod +x ./scripts/* | |
- name: Destroy state and delete production workspace | |
if: contains(github.event.ref_type, 'branch') && github.event.ref == 'refs/heads/production' | |
env: | |
ENV: production | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_production }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_production }} | |
AWS_REGION: ${{ secrets.aws_region_production }} | |
run: ./scripts/delete_workspace -f -g "no_sha_awailable" | |
- name: Destroy state and delete staging workspace | |
if: contains(github.event.ref_type, 'branch') && github.event.ref == 'refs/heads/staging' | |
env: | |
ENV: staging | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_staging }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_staging }} | |
AWS_REGION: ${{ secrets.aws_region_staging }} | |
run: ./scripts/delete_workspace -f -g "no_sha_awailable" | |
- name: Destroy state and delete dev workspace | |
if: contains(github.event.ref_type, 'branch') && github.event.ref == 'refs/heads/dev' | |
env: | |
ENV: dev | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_key_dev }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_dev }} | |
AWS_REGION: ${{ secrets.aws_region_Dev }} | |
run: ./scripts/delete_workspace -f -g "no_sha_awailable" |