-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
33 lines (29 loc) · 899 Bytes
/
action.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
name: "Google Cloud Container Registry"
description: "Push a docker image to Google Cloud Container Registry"
branding:
icon: "upload-cloud"
color: "red"
inputs:
creds:
description: "Contents of a Service Account JSON Key"
required: true
registry:
description: "Registry host name (must match dst image)"
required: false
default: "gcr.io"
src:
description: "Source image name"
required: true
dst:
description: "Destination image name"
required: true
runs:
using: "composite"
steps:
- name: Push to Google Cloud Container Registry
shell: bash
run: |
docker login -u _json_key -p '${{ inputs.creds }}' 'https://${{ inputs.registry }}' 2>/dev/null
docker tag '${{ inputs.src }}' '${{ inputs.dst }}'
docker push '${{ inputs.dst }}'
echo "Successfully pushed ${{ inputs.src }} to ${{ inputs.dst }}"