-
Notifications
You must be signed in to change notification settings - Fork 2.1k
53 lines (48 loc) · 1.8 KB
/
release-stable-en.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Release stable EN image
on:
workflow_dispatch:
inputs:
tag_name:
description: "Tag of an image"
type: string
required: true
jobs:
release:
# TODO: After migraton switch to CI
runs-on: [matterlabs-default-infra-runners]
steps:
- name: Login to Docker registries
run: |
docker login -u ${{ secrets.DOCKERHUB_USER }} -p ${{ secrets.DOCKERHUB_TOKEN }}
gcloud auth configure-docker us-docker.pkg.dev -q
- name: Check if alpha image exists
run: |
set +e
docker manifest inspect matterlabs/external-node:${{ inputs.tag_name }}-alpha >/dev/null 2>&1
exitcode=$?
set -e
if [[ "$exitcode" -eq "1" ]]; then
echo "Image matterlabs/external-node:${{ inputs.tag_name }}-alpha doesn't exist"
exit 1
fi
- name: Push stable image
run: |
docker_repositories=("matterlabs/external-node" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/external-node")
platforms=("linux/amd64" "linux/arm64")
tag_name="${{ inputs.tag_name }}"
for repo in "${docker_repositories[@]}"; do
platform_tags=""
for platform in "${platforms[@]}"; do
platform=$(echo $platform | tr '/' '-')
alpha_tag="${repo}:${tag_name}-alpha-${platform}"
tag="${repo}:${tag_name}-${platform}"
docker pull $alpha_tag
docker tag $alpha_tag $tag
docker push $tag
platform_tags+=" --amend $tag"
done
for manifest in "${repo}:${tag_name}" "${repo}:2.0-${tag_name}"; do
docker manifest create ${manifest} ${platform_tags}
docker manifest push ${manifest}
done
done