-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (29 loc) · 1.02 KB
/
openID-gcp.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
# This workflow shows how to use OpenID GCP tokens.
name: OpenID GCP token
permissions:
contents: read
id-token: write
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: 'auth'
name: 'Authenticate to GCP'
uses: 'google-github-actions/auth@v0.8.0'
with:
create_credentials_file: 'true'
workload_identity_provider: 'projects/844024446343/locations/global/workloadIdentityPools/github-action-identity-pool/providers/github-actions-oidc-token'
service_account: 'github-actions-vms@github-actions-356108.iam.gserviceaccount.com'
- id: 'gcloud'
name: 'gcloud'
run: |-
gcloud services list
gcloud compute instances create instance-1 \
--project=github-actions-356108 \
--zone=us-central1-a \
--machine-type=e2-micro \
--network-interface=network-tier=PREMIUM,subnet=default \
--maintenance-policy=MIGRATE