-
Notifications
You must be signed in to change notification settings - Fork 259
59 lines (49 loc) · 1.75 KB
/
_merge.yml
File metadata and controls
59 lines (49 loc) · 1.75 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
# Internal reusable workflow for merging platform-specific image digests into a
# single multi-platform manifest and pushing to GHCR.
#
# This workflow takes the individual platform image digests created by _build.yml,
# combines them into a multi-platform manifest, and pushes the final tagged images.
name: Merge Multi-Platform Manifest
on:
workflow_call:
inputs:
docker_tags:
description: "Docker tags configuration (JSON array or raw tags)"
required: true
type: string
env:
REGISTRY_IMAGE: ghcr.io/sourcebot-dev/sourcebot
jobs:
merge:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY_IMAGE }}
tags: ${{ inputs.docker_tags }}
- name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create manifest list and push
working-directory: /tmp/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}