-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (32 loc) · 1007 Bytes
/
cloud-build.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
name: Build using Cloud Build
on:
push:
branches:
- 'main'
workflow_dispatch:
env:
PROJECT_ID: la-ctf
jobs:
setup-build-deploy:
name: Setup, Build, and Deploy
runs-on: ubuntu-latest
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout
uses: actions/checkout@v3
# Configure Workload Identity Federation and generate an access token.
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/227102684565/locations/global/workloadIdentityPools/github-pool/providers/github'
service_account: 'github-ci@la-ctf.iam.gserviceaccount.com'
# Setup gcloud CLI
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
# Build and push image to Google Container Registry
- name: Build
run: gcloud builds submit --region=us-west2