Skip to content

Commit

Permalink
chore(): modified the deploy.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
Arielpetit committed Nov 22, 2024
1 parent 4f88131 commit 80bf002
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 70 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Terraform Deployment
on:
push:
branches:
- main # Trigger on pushes to the main branch
- setup-workflow

jobs:
terraform:
Expand All @@ -18,12 +18,15 @@ jobs:
with:
terraform_version: 1.9.8

- name: Configure Cloud Credentials
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID && \
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Terraform Validate
run: terraform validate

- name: Terraform Init
run: terraform init
Expand All @@ -32,5 +35,6 @@ jobs:
run: terraform plan -out=plan.tfplan

- name: Terraform Apply
if: github.ref == 'refs/heads/main'
if: github.ref_name == 'setup-workflow'
run: terraform apply -auto-approve plan.tfplan

62 changes: 0 additions & 62 deletions terraform/main.tf

This file was deleted.

0 comments on commit 80bf002

Please sign in to comment.