Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
koenighotze committed May 10, 2024
1 parent 0453ff4 commit a47be8a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,12 @@ jobs:
- name: Init
run: terraform init -backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}"
- name: Apply
run: terraform apply --auto-approve
run: terraform apply -auto-approve
- name: Show Terraform Output as Summary
run: |
{
echo "### Terraform Output";
echo "\`\`\`";
terraform output;
echo "\`\`\`";
} > "${GITHUB_STEP_SUMMARY}"
40 changes: 40 additions & 0 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Bootstrap setup

on:
workflow_dispatch:
inputs:
apply_plan:
description: "Apply plan?"
required: false
default: "no"
push:
paths:
- bootstrap/**
Expand Down Expand Up @@ -78,6 +83,11 @@ jobs:
run: terraform validate -no-color

plan:
needs:
- compliance-scan
- lint
- qa

runs-on: ubuntu-20.04

steps:
Expand Down Expand Up @@ -105,3 +115,33 @@ jobs:
terraform show -no-color tfplan;
echo "\`\`\`";
} > "${GITHUB_STEP_SUMMARY}"
apply:
if: ${{ github.event.inputs.apply_plan == 'yes' }}
needs: plan

runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticating
uses: google-github-actions/[email protected]
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SEED_SA_EMAIL_ADDRESS }}
- name: Setting up GCP environment
uses: google-github-actions/[email protected]
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Init
run: terraform init -backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}"
- name: Apply
run: terraform apply -auto-approve
- name: Show Terraform Output as Summary
run: |
{
echo "### Terraform Output";
echo "\`\`\`";
terraform output;
echo "\`\`\`";
} > "${GITHUB_STEP_SUMMARY}"
10 changes: 9 additions & 1 deletion .github/workflows/plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,12 @@ jobs:
- name: Init
run: terraform init -backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}"
- name: Plan
run: terraform plan -no-color
run: terraform plan -no-color -out=tfplan
- name: Show Terraform Plan as Summary
run: |
{
echo "### Terraform Plan Output";
echo "\`\`\`";
terraform show -no-color tfplan;
echo "\`\`\`";
} > "${GITHUB_STEP_SUMMARY}"

0 comments on commit a47be8a

Please sign in to comment.