-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 1.7 KB
/
docker-release.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
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
name: Docker Release
on:
workflow_call:
inputs:
PROJECT:
type: string
required: true
GCP_REGISTRY:
type: string
required: false
default: "eu.gcr.io"
GAR_REGISTRY:
type: string
required: false
default: "europe-west3-docker.pkg.dev"
secrets:
GCR_JSON_KEY:
required: true
GAR_HELM_REGISTRY_ACCOUNT:
required: true
jobs:
docker-release:
runs-on: ubuntu-22.04
steps:
- name: lowercase things
id: lowercase
env:
project: ${{inputs.PROJECT}}
run: |
echo "project=${project,,}" >> "$GITHUB_OUTPUT"
- name: download a build artifact
uses: actions/[email protected]
id: download
with:
name: artifacts_image_${{steps.lowercase.outputs.project}}
- name: load image
id: image_ids
run: |
{
echo 'ids<<EOF'
docker image load --input image_${{steps.lowercase.outputs.project}}.tar | sed 's/Loaded image: //g'
echo EOF
} >> $GITHUB_OUTPUT
- name: login to gcr
uses: docker/[email protected]
with:
registry: ${{ inputs.GCP_REGISTRY }}
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
- name: login to gar
uses: docker/[email protected]
with:
registry: ${{ inputs.GAR_REGISTRY}}
username: _json_key
password: ${{ secrets.GAR_HELM_REGISTRY_ACCOUNT }}
- name: push to registry
run: |
TAGS="${{steps.image_ids.outputs.ids}}"
for tag in ${TAGS}; do
docker push "${tag}"
done