-
Notifications
You must be signed in to change notification settings - Fork 179
41 lines (41 loc) · 1.66 KB
/
push-multi-arch-image.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
name: Push Multi Arch Image
on:
workflow_call:
inputs:
prefix:
required: true
type: string
pom_dir:
required: false
type: string
default: '.'
target_ref:
required: false
type: string
default: 'refs/heads/main'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
if: github.ref == inputs.target_ref
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker manifest push
if: github.ref == inputs.target_ref
run: |
docker manifest create ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}_${GITHUB_SHA} \
--amend ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}_amd64_${GITHUB_SHA} \
--amend ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}_aarch64_${GITHUB_SHA}
docker manifest create ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }} \
--amend ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}_amd64_${GITHUB_SHA} \
--amend ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}_aarch64_${GITHUB_SHA}
docker manifest push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}_${GITHUB_SHA}
docker manifest push ghcr.io/${{ github.repository }}/${{ inputs.pom_dir }}:${{ inputs.prefix }}