-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (63 loc) · 1.89 KB
/
deploy.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
59
60
61
62
63
64
65
66
67
68
69
---
name: Deploy to Google Cloud
concurrency: production
on:
release:
types:
- created
push:
branches:
- 'releases/*'
tags:
- '*-rc'
workflow_dispatch:
inputs:
containerTag:
required: true
description: 'The docker tag for a container already in GCP'
env:
GCP_REGION: us-west1
GKE_CLUSTER_NAME: fnf-apps-cluster-west1
jobs:
deploy:
name: TicketBoothDeploy
runs-on: ubuntu-latest
environment: ${{ vars.ENVIRONMENT }}
permissions:
contents: 'read'
id-token: 'write'
steps:
# This step is only required because the Helm chart is in this repo
- id: checkout
name: TicketBooth checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && 'main' || github.ref }}
fetch-depth: 1
- id: gcpAuth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/${{ vars.GCP_PROJECT_ID }}/locations/global/workloadIdentityPools"
service_account: ${{ vars.GCP_SERVICE_ACCOUNT_ID }}
- id: gkeLogin
name: GKE Login
uses: google-github-actions/get-gke-credentials@v2
with:
cluster_name: ${{ env.GKE_CLUSTER_NAME }}
location: ${{ env.GCP_REGION }}
- id: runHelm
name: Helm Update
uses: deliverybot/helm@v1
with:
release: ${{ vars.HELM_RELEASE }}
namespace: default
chart: deployment/chart
token: ${{ github.token }}
values: |
image.tag: ${{ github.event_name == 'workflow_dispatch' && inputs.containerTag || github.ref_name }}
value-files: >-
[
"deployment/env/base.yaml",
"deployment/${{ environment }}.yaml"
]
atomic: ${{ github.event_name == 'workflow_dispatch' && false || true }}