Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
SERVICE_ACCOUNT: ${{ secrets.DEV_SERVICE_ACCOUNT }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
LOCATION: ${{ secrets.LOCATION }}


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
job_id:
runs-on: 'ubuntu-latest'
permissions:
contents: 'read'
id-token: 'write'

steps:
- uses: 'actions/checkout@v4'

- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
workload_identity_provider: ${{ env.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ env.SERVICE_ACCOUNT }}

- id: 'SetupCloudSDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

- id: 'list-all-files'
run: 'ls -ltrh'

- id : 'Infrastructure-Manager-Deployment'
run: 'gcloud infra-manager deployments apply projects/${{ env.PROJECT_ID }}/locations/${{ env.LOCATION }}/deployments/inframanager --service-account ${{ env.SERVICE_ACCOUNT }} --local-source="."'

7 changes: 7 additions & 0 deletions examples/guardrails/cloudbuild/inframanager/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resource "google_storage_bucket" "inframanager" {
name = "inframanager"
location = "US"
force_destroy = true
project = "cmetestproj"
public_access_prevention = "enforced"
}
23 changes: 23 additions & 0 deletions examples/guardrails/cloudbuild/inframanager/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
terraform {
required_version = "~> 1.2.3"

required_providers {
google = {
source = "hashicorp/google"
version = ">= 5.12"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 5.12"
}
}
}


provider "google" {
impersonate_service_account = "<Service Account name>"
}

provider "google-beta" {
impersonate_service_account = "<Service Account name>"
}