Skip to content

Commit

Permalink
feat: workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusBLopes committed May 13, 2024
1 parent 858d52c commit c5c9f84
Showing 1 changed file with 11 additions and 22 deletions.
33 changes: 11 additions & 22 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,17 @@ env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
terraform:
name: 'Deploy'
terraform_apply:
name: Terraform Apply
runs-on: ubuntu-latest

defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.0

- name: Run terraform init
run: terraform init

- name: Run terraform format check
run: terraform fmt --check

- name: Run terraform plan
run: terraform plan

- name: Run terraform apply
- name: Checkout
uses: actions/checkout@v4
- name: Terraform Apply
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: terraform apply --auto-approve
run: |
terraform init
terraform apply -auto-approve

0 comments on commit c5c9f84

Please sign in to comment.