Skip to content

Commit

Permalink
trying a check
Browse files Browse the repository at this point in the history
  • Loading branch information
proquickly committed Nov 6, 2024
1 parent e525247 commit 72c24b1
Showing 1 changed file with 32 additions and 27 deletions.
59 changes: 32 additions & 27 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches:
- main

pull_request:
branches:
- main
jobs:
terraform:
runs-on: ubuntu-latest
Expand All @@ -13,29 +15,32 @@ jobs:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.8

- name: Terraform Init
run: terraform init
working-directory: terraform

- name: Terraform Plan
run: terraform plan -out=tfplan
working-directory: terraform

- name: Terraform Apply
run: terraform apply tfplan
working-directory: terraform
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2

- name: Verify AWS credentials
run: aws sts get-caller-identity

- name: Terraform Init
run: terraform init
working-directory: terraform

- name: Terraform Plan
run: terraform plan -out=tfplan
working-directory: terraform

- name: Upload plan file
uses: actions/upload-artifact@v3
with:
name: tfplan
path: terraform/tfplan

0 comments on commit 72c24b1

Please sign in to comment.