Skip to content

Commit

Permalink
fix(ci/cd): working directory to run command steps
Browse files Browse the repository at this point in the history
  • Loading branch information
igr-santos committed Nov 7, 2024
1 parent 5d3ca57 commit 1b8282a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/terraform-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,30 @@ jobs:
# Como estamos publicando uma infraestrutura na AWS é necessário garantir
# a configuração dos secrets AWS_ACCESS_KEY_ID e AWS_SECRET_ACCESS_KEY no repositório do Github.
- name: Terraform Initialize
working-directory: ./instances
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: terraform init

- name: Terraform Validate
working-directory: ./instances
run: terraform validate

# Define que iremos trabalhar no ambiente de stage
- name: Terraform Select Workspace
working-directory: ./instances
run: terraform workspace select stage

- name: Terraform Plan
working-directory: ./instances
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: terraform plan

- name: Terraform Apply
working-directory: ./instances
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down

0 comments on commit 1b8282a

Please sign in to comment.