Skip to content

Apply project directory #14

Apply project directory

Apply project directory #14

Workflow file for this run

name: Apply
on:
workflow_dispatch:
env:
TF_VAR_workload_identity_provider_name: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
TF_VAR_workload_identity_pool_id: ${{ secrets.WORKLOAD_IDENTITY_POOL_ID }}
TF_VAR_project_id: ${{ secrets.GCP_PROJECT_ID }}
TF_VAR_sa_email: ${{ secrets.CICD_SA_EMAIL_ADDRESS }}
TF_IN_AUTOMATION: true
TF_INPUT: false
CLOUDSDK_CORE_PROJECT: ${{ secrets.GCP_PROJECT_ID }}
permissions:
id-token: write
jobs:
compliance-scan:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Checkov action
id: checkov
uses: bridgecrewio/checkov-action@v12.2641.0
with:
framework: terraform
# we are fine with Google's Keys
# we are fine with basic roles (no org), we are fine with our own module
skip_check: CKV_GCP_84,CKV_GIT_4,CKV_GCP_117,CKV_TF_1,CKV2_GCP_18
output_format: cli
download_external_modules: true
apply:
runs-on: ubuntu-20.04
needs:
- compliance-scan
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticating
uses: google-github-actions/auth@v2.1.1
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.CICD_SA_EMAIL_ADDRESS }}
- name: Setting up GCP environment
uses: google-github-actions/setup-gcloud@v2.0.1
- 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