-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (73 loc) · 2.2 KB
/
docker-release.yaml
File metadata and controls
80 lines (73 loc) · 2.2 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
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/download-artifact@v5.0.0
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/login-action@v3.6.0
with:
registry: ${{ inputs.GCP_REGISTRY }}
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
- name: login to gar
uses: docker/login-action@v3.6.0
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
- name: create summary
run: |
echo "## ✨ Docker Tags pushed to registry" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Repository | Tag |" >> $GITHUB_STEP_SUMMARY
echo "| ---------- | --- |" >> $GITHUB_STEP_SUMMARY
TAGS="${{steps.image_ids.outputs.ids}}"
for tag in ${TAGS}; do
repo="${tag%%:*}"
tagname="${tag##*:}"
echo "| ${repo} | ${tagname} |" >> $GITHUB_STEP_SUMMARY
done