Skip to content

Commit

Permalink
fix(.github/workflows/workflow.yml): job destroy fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
plbalmeida committed Jan 23, 2024
1 parent 8dd932d commit ed1e2bb
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@ on:

jobs:

destroy:
runs-on: ubuntu-latest
needs: build
if: ${{ github.event.inputs.destroy == 'true' }}
steps:
- uses: actions/checkout@v2

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1

- name: Terraform Init
run: terraform init
working-directory: ./infra

- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: ./infra
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1

build:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -97,3 +75,24 @@ jobs:
- name: Start AWS CodeBuild
run: |
aws codebuild start-build --project-name practical-mlops-ch1-exercises
destroy:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.destroy == 'true' }}
steps:
- uses: actions/checkout@v2

- name: Setup Terraform
uses: hashicorp/setup-terraform@v1

- name: Terraform Init
run: terraform init
working-directory: ./infra

- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: ./infra
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1

0 comments on commit ed1e2bb

Please sign in to comment.