v1.7 #24
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
needs: [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 |