Skip to content

Commit 1188d2f

Browse files
author
Jeremy Price
committed
lets try to combine arches with a manifest, first the simple way
1 parent 8e7b2a0 commit 1188d2f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/docker-ubuntu.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ jobs:
3232
IMAGE_TAGS: |
3333
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
3434
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
35+
type=raw,value={{branch}}-ubuntu-arm
3536
type=ref,event=tag
3637
type=semver,pattern=v{{major}}-latest
3738
# Define default tag "flavor" for docker/metadata-action per
@@ -89,13 +90,16 @@ jobs:
8990
# Ensure this job never runs on forked repos. It's only executed for 'grokability/snipe-it'
9091
if: github.repository == 'grokability/snipe-it'
9192
runs-on: ubuntu-latest
93+
outputs:
94+
tags: ${{ steps.gen_output.outputs.tags }}
9295
env:
9396
# Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
9497
# For a new commit on default branch (master), use the literal tag 'latest' on Docker image.
9598
# For a new commit on other branches, use the branch name as the tag for Docker image.
9699
# For a new tag, copy that tag name as the tag for Docker image.
97100
IMAGE_TAGS: |
98101
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
102+
type=raw,value={{branch}}-ubuntu-intel
99103
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
100104
type=ref,event=tag
101105
type=semver,pattern=v{{major}}-latest
@@ -150,3 +154,29 @@ jobs:
150154
# Use tags / labels provided by 'docker/metadata-action' above
151155
tags: ${{ steps.meta_build.outputs.tags }}
152156
labels: ${{ steps.meta_build.outputs.labels }}
157+
- name: Generate output
158+
id: gen_output
159+
run: |
160+
echo "tags=${{ steps.meta_build.outputs.tags }}" >> "$GITHUB_OUTPUT"
161+
combinator:
162+
name: combine multiple arches into a single "image"
163+
needs: [docker-ubuntu-intel, docker-ubuntu-arm]
164+
runs-on: ubuntu-latest
165+
steps:
166+
# https://github.com/docker/login-action
167+
- name: Login to DockerHub
168+
# Only login if not a PR, as PRs only trigger a Docker build and not a push
169+
if: github.event_name != 'pull_request'
170+
uses: docker/login-action@v3
171+
with:
172+
username: ${{ secrets.DOCKER_USERNAME }}
173+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
174+
175+
- name: combine manifests
176+
uses: Noelware/docker-manifest-action@v1
177+
with:
178+
tags: snipe/snipe-it:{{branch}}-combined
179+
inputs: snipe/snipe-it:{{branch}}-intel,snipe/snipe-it:{{branch}}-arm
180+
push: true
181+
182+

0 commit comments

Comments
 (0)