Skip to content

Commit

Permalink
removed storing the plan as an artifact (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
agjmills authored Aug 20, 2024
1 parent 413648e commit 46798e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ jobs:
- name: Initialize Terraform
run: terraform init -backend-config="bucket=tf-state-${{ secrets.AWS_REGION }}-${{ secrets.AWS_ACCOUNT_ID }}" -backend-config="key=${{ github.repository }}.tfstate" -backend-config="dynamodb_table=tf-state-${{ secrets.AWS_REGION }}-${{ secrets.AWS_ACCOUNT_ID }}"

- name: Plan Terraform (Ensure Consistency)
run: terraform plan -out=plan.cache

- name: Apply Terraform
run: terraform apply -auto-approve plan.json
run: terraform apply -auto-approve plan.cache
13 changes: 1 addition & 12 deletions .github/workflows/plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,4 @@ jobs:
run: terraform init -backend-config="bucket=tf-state-${{ secrets.AWS_REGION }}-${{ secrets.AWS_ACCOUNT_ID }}" -backend-config="key=${{ github.repository }}.tfstate" -backend-config="dynamodb_table=tf-state-${{ secrets.AWS_REGION }}-${{ secrets.AWS_ACCOUNT_ID }}"

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

- name: Save Terraform Plan
run: |
echo "Saving Terraform plan..."
terraform show -json tfplan > plan.json
- name: Upload Terraform Plan
uses: actions/upload-artifact@v3
with:
name: terraform-plan
path: plan.json
run: terraform plan

0 comments on commit 46798e7

Please sign in to comment.