-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.89 KB
/
create-gke-cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: "Create new GKE cluster"
on:
workflow_dispatch:
jobs:
create-cluster:
permissions:
id-token: write
contents: read
name: "Terraform create GKE cluster"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./gke-terraform-config
env:
TF_VAR_service_account: [email protected]
TF_VAR_project_id: code-idp
TF_VAR_max_node_count: 3
TF_VAR_initial_node_count: 1
TF_VAR_namedotcom_username: "notemann27" # temporary until we use a different domain
TF_VAR_namedotcom_token: ${{secrets.NAMEDOTCOM_TOKEN}} # temporary until we use a different domain
TF_VAR_idp_domain_name: "laurinnotemann.dev" # temporary until we use a different domain
TF_VAR_certificate_issuer_email: "[email protected]" # temporary until we use a different domain
steps:
- name: Checkout
uses: actions/checkout@v4
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
create_credentials_file: true
workload_identity_provider: 'projects/1006240973223/locations/global/workloadIdentityPools/gha-create-gke-cluster/providers/github-actions'
service_account: '[email protected]'
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.8.2"
- name: Terraform fmt
id: fmt
run: terraform fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Plan
id: plan
run: terraform plan -no-color
- name: Terraform apply
id: apply
run: terraform apply -no-color -auto-approve