Skip to content

Commit ee78a88

Browse files
committed
Push also a less basic (but ready) ArchLinuxARM image
1 parent 87de694 commit ee78a88

1 file changed

Lines changed: 41 additions & 9 deletions

File tree

.github/workflows/buildx.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ permissions:
1515

1616
env:
1717
REGISTRY: ghcr.io
18-
IMAGE_NAME: ${{ github.repository_owner }}/archlinuxarm-basic
18+
MINIMAL_IMAGE_NAME: ${{ github.repository_owner }}/archlinuxarm-basic
19+
ALARM_IMAGE_NAME: ${{ github.repository_owner }}/archlinuxarm
1920
PLATFORMS: linux/arm64
20-
DOCKERFILE: dockerfiles/Dockerfile.base
21+
MINIMAL_DOCKERFILE: dockerfiles/Dockerfile.base
22+
ALARM_DOCKERFILE: dockerfiles/Dockerfile.aarch64
2123
TARGET: archarm
2224

2325
jobs:
@@ -50,13 +52,14 @@ jobs:
5052
- name: Derive image name
5153
id: img
5254
run: |
53-
echo "IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" >> $GITHUB_OUTPUT
55+
echo "MINIMAL_IMAGE=${{ env.REGISTRY }}/${{ env.MINIMAL_IMAGE_NAME }}" >> $GITHUB_OUTPUT
56+
echo "ALARM_IMAGE=${{ env.REGISTRY }}/${{ env.ALARM_IMAGE_NAME }}" >> $GITHUB_OUTPUT
5457
5558
- name: Extract Docker metadata (tags, labels)
56-
id: meta
59+
id: meta-minimal
5760
uses: docker/metadata-action@v5
5861
with:
59-
images: ${{ steps.img.outputs.IMAGE }}
62+
images: ${{ steps.img.outputs.MINIMAL_IMAGE }}
6063
# Tag strategy:
6164
# - main branch -> :latest and :sha
6265
# - tags like v1.2.3 -> :1.2.3 and :1.2 and :1
@@ -65,17 +68,46 @@ jobs:
6568
type=raw,value=latest,enable={{is_default_branch}}
6669
type=ref,event=tag
6770
68-
- name: Build (and push when not a PR)
71+
- name: Extract Docker metadata (tags, labels)
72+
id: meta-alarm
73+
uses: docker/metadata-action@v5
74+
with:
75+
images: ${{ steps.img.outputs.ALARM_IMAGE }}
76+
# Tag strategy:
77+
# - main branch -> :latest and :sha
78+
# - tags like v1.2.3 -> :1.2.3 and :1.2 and :1
79+
# - PRs -> :pr-<num>-<sha>
80+
tags: |
81+
type=raw,value=latest,enable={{is_default_branch}}
82+
type=ref,event=tag
83+
84+
- name: Build minimal (and push when not a PR)
6985
id: buildx
7086
uses: docker/build-push-action@v6
7187
with:
7288
context: .
73-
file: ${{ env.DOCKERFILE }}
89+
file: ${{ env.MINIMAL_DOCKERFILE }}
7490
target: ${{ env.TARGET }}
7591
platforms: ${{ env.PLATFORMS }}
7692
push: ${{ github.event_name != 'pull_request' }}
77-
tags: ${{ steps.meta.outputs.tags }} # mirrors: -t $(IMAGE):minimal-aarch64 (+ semver / sha variants)
78-
labels: ${{ steps.meta.outputs.labels }}
93+
tags: ${{ steps.meta-minimal.outputs.tags }} # mirrors: -t $(IMAGE):minimal-aarch64 (+ semver / sha variants)
94+
labels: ${{ steps.meta-minimal.outputs.labels }}
95+
# Your local command used --load; in CI we push instead. (--load is single-arch only and not suited for multi-arch CI.)
96+
cache-from: type=gha
97+
cache-to: type=gha,mode=max
98+
provenance: false
99+
sbom: false
100+
101+
- name: Build ArchLinuxARM (and push when not a PR)
102+
id: buildx
103+
uses: docker/build-push-action@v6
104+
with:
105+
context: .
106+
file: ${{ env.ALARM_DOCKERFILE }}
107+
platforms: ${{ env.PLATFORMS }}
108+
push: ${{ github.event_name != 'pull_request' }}
109+
tags: ${{ steps.meta-alarm.outputs.tags }} # mirrors: -t $(IMAGE):minimal-aarch64 (+ semver / sha variants)
110+
labels: ${{ steps.meta-alarm.outputs.labels }}
79111
# Your local command used --load; in CI we push instead. (--load is single-arch only and not suited for multi-arch CI.)
80112
cache-from: type=gha
81113
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)