-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
32 lines (29 loc) · 1.13 KB
/
action.yaml
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
name: Google Artifact Registry Login
description: Authenticate to Google Cloud and login to Google Artifact Registry.
inputs:
GCP_WORKLOAD_IDENTITY_PROVIDER:
description: "The GCP Workload Identity Provider to use for authentication."
required: true
GCP_SERVICE_ACCOUNT_EMAIL:
description: "The GCP Service Account Email to use for authentication."
required: true
create_credentials_file:
description: "Whether to create a credentials file."
default: "false"
runs:
using: composite
steps:
- id: auth
name: "Authenticate to Google Cloud"
uses: google-github-actions/[email protected]
with:
create_credentials_file: ${{ inputs.create_credentials_file == 'true' }}
token_format: "access_token"
workload_identity_provider: ${{ inputs.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ inputs.GCP_SERVICE_ACCOUNT_EMAIL }}
- name: Login to Google Artifact Registry
uses: docker/[email protected]
with:
registry: us-docker.pkg.dev # use multi-region GAR
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}