-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (73 loc) · 2.64 KB
/
deploy.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
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub for ${{ matrix.platform }}
runs-on:
group: ${{ matrix.runner_group }}
permissions:
packages: write
contents: read
attestations: write
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
include:
- platform: linux/amd64
runner_group: large_amd64
platform_tag: amd64
- platform: linux/arm64
runner_group: large_arm64
platform_tag: arm64
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ambarltd
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ambarltd/emulator
- name: Build Docker image for ${{ matrix.platform }}
id: push
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: ./build/
file: ./build/Dockerfile
pull: false
push: true
platforms: ${{ matrix.platform }}
tags: ambarltd/emulator:${{ github.event.release.tag_name }}-${{ matrix.platform_tag }}
labels: ${{ steps.meta.outputs.labels }}
merge_manifests:
name: Merge manifests to prevent overrides on Docker Hub
runs-on: ubuntu-20.04
depends-on: push_to_registry
permissions:
packages: write
contents: read
attestations: write
steps:
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ambarltd
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Merge and push manifests
run: |
docker manifest create ambarltd/emulator:${{ github.event.release.tag_name }} \
--amend ambarltd/emulator:${{ github.event.release.tag_name }}-amd64 \
--amend ambarltd/emulator:${{ github.event.release.tag_name }}-arm64
docker manifest push ambarltd/emulator:${{ github.event.release.tag_name }}
docker manifest create ambarltd/emulator:latest \
--amend ambarltd/emulator:${{ github.event.release.tag_name }}-amd64 \
--amend ambarltd/emulator:${{ github.event.release.tag_name }}-arm64
docker manifest push ambarltd/emulator:latest