Skip to content

Commit

Permalink
fix terraform staging action
Browse files Browse the repository at this point in the history
  • Loading branch information
ER-Radi committed Jan 11, 2024
1 parent f4297cb commit ac2ba3f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/terraform-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_TF_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TF_SECRET_ACCESS_KEY }}
aws-region: eu-west-3

- name: Set up Terraform
uses: hashicorp/setup-terraform@v1
with:
Expand All @@ -26,11 +33,11 @@ jobs:
if: success()

- name: Terraform Plan
run: terraform plan -var-file=variables.tfvars
run: terraform plan -var-file=../../terraform/terraform.tfvars
if: success()

- name: Terraform Apply
run: terraform apply -var-file=variables.tfvars -auto-approve
run: terraform apply -var-file=../../terraform/terraform.tfvars -auto-approve
if: success()

- name: Extract Public IP
Expand All @@ -39,13 +46,6 @@ jobs:
echo "::set-output name=server_public_ip::$(terraform output server_public_ip)"
if: success()

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_TF_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TF_SECRET_ACCESS_KEY }}
aws-region: eu-west-3

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
Expand Down

0 comments on commit ac2ba3f

Please sign in to comment.