Skip to content

Commit 57385dc

Browse files
authored
feat(docker): add stable tag (#360)
1 parent 4b82469 commit 57385dc

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/continuous-delivery-docker.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jobs:
8282
echo "Release tag: ${{ github.event.release.tag_name }}"
8383
echo "tag=ui-${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
8484
echo "tag_dynamic=ui-dynamic-${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
85+
echo "tag_stable=stable" >> "$GITHUB_OUTPUT"
8586
else
8687
echo "Not a PR branch"
8788
echo "tag=ui" >> "$GITHUB_OUTPUT"
@@ -212,6 +213,7 @@ jobs:
212213
elif [ -n "${{ github.event.release.tag_name }}" ]; then
213214
echo "Release tag: ${{ github.event.release.tag_name }}"
214215
echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
216+
echo "tag_stable=stable" >> "$GITHUB_OUTPUT"
215217
else
216218
echo "Not a PR branch"
217219
echo "tag=latest" >> "$GITHUB_OUTPUT"
@@ -260,6 +262,8 @@ jobs:
260262
tags: |
261263
ghcr.io/dan-online/autopulse:${{ steps.tag.outputs.tag }}${{ matrix.platform.tag }}
262264
danonline/autopulse:${{ steps.tag.outputs.tag }}${{ matrix.platform.tag }}
265+
${{ steps.tag.outputs.tag_stable && format('ghcr.io/dan-online/autopulse:{0}{1}', steps.tag.outputs.tag_stable, matrix.platform.tag) || '' }}
266+
${{ steps.tag.outputs.tag_stable && format('danonline/autopulse:{0}{1}', steps.tag.outputs.tag_stable, matrix.platform.tag) || '' }}
263267
labels: ${{ steps.meta.outputs.labels }}
264268
platforms: ${{ matrix.platform.name }}
265269
build-args: ${{ matrix.platform.build_args }}
@@ -274,6 +278,8 @@ jobs:
274278
tags: |
275279
ghcr.io/dan-online/autopulse:${{ steps.tag.outputs.tag }}-${{ matrix.feature }}${{ matrix.platform.tag }}
276280
danonline/autopulse:${{ steps.tag.outputs.tag }}-${{ matrix.feature }}${{ matrix.platform.tag }}
281+
${{ steps.tag.outputs.tag_stable && format('ghcr.io/dan-online/autopulse:{0}-{1}{2}', steps.tag.outputs.tag_stable, matrix.feature, matrix.platform.tag) || '' }}
282+
${{ steps.tag.outputs.tag_stable && format('danonline/autopulse:{0}-{1}{2}', steps.tag.outputs.tag_stable, matrix.feature, matrix.platform.tag) || '' }}
277283
labels: ${{ steps.meta.outputs.labels }}
278284
platforms: ${{ matrix.platform.name }}
279285
build-args: ${{ matrix.platform.build_args }}
@@ -295,6 +301,7 @@ jobs:
295301
elif [ -n "${{ github.event.release.tag_name }}" ]; then
296302
echo "Release tag: ${{ github.event.release.tag_name }}"
297303
echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
304+
echo "tag_stable=stable" >> "$GITHUB_OUTPUT"
298305
else
299306
echo "Not a PR branch"
300307
echo "tag=latest" >> "$GITHUB_OUTPUT"
@@ -323,6 +330,7 @@ jobs:
323330
GHCR_BASE="ghcr.io/dan-online/autopulse"
324331
DOCKERHUB_BASE="danonline/autopulse"
325332
TAG="${{ steps.tag.outputs.tag }}"
333+
TAG_STABLE="${{ steps.tag.outputs.tag_stable }}"
326334
327335
# First, create and push all manifests to GHCR
328336
# Get digests from GHCR only
@@ -369,6 +377,35 @@ jobs:
369377
--tag danonline/autopulse:${TAG}-sqlite \
370378
ghcr.io/dan-online/autopulse:${TAG}-sqlite
371379
380+
if [ -n "$TAG_STABLE" ]; then
381+
echo "Creating stable manifests..."
382+
docker manifest create ${GHCR_BASE}:${TAG_STABLE} \
383+
--amend ${GHCR_BASE}@${AMD64_DIGEST} \
384+
--amend ${GHCR_BASE}@${ARM64_DIGEST}
385+
docker manifest create ${GHCR_BASE}:${TAG_STABLE}-postgres \
386+
--amend ${GHCR_BASE}@${POSTGRES_AMD64_DIGEST} \
387+
--amend ${GHCR_BASE}@${POSTGRES_ARM64_DIGEST}
388+
docker manifest create ${GHCR_BASE}:${TAG_STABLE}-sqlite \
389+
--amend ${GHCR_BASE}@${SQLITE_AMD64_DIGEST} \
390+
--amend ${GHCR_BASE}@${SQLITE_ARM64_DIGEST}
391+
392+
docker manifest push ${GHCR_BASE}:${TAG_STABLE}-postgres
393+
docker manifest push ${GHCR_BASE}:${TAG_STABLE}-sqlite
394+
docker manifest push ${GHCR_BASE}:${TAG_STABLE}
395+
396+
docker buildx imagetools create \
397+
--tag danonline/autopulse:${TAG_STABLE} \
398+
ghcr.io/dan-online/autopulse:${TAG_STABLE}
399+
400+
docker buildx imagetools create \
401+
--tag danonline/autopulse:${TAG_STABLE}-postgres \
402+
ghcr.io/dan-online/autopulse:${TAG_STABLE}-postgres
403+
404+
docker buildx imagetools create \
405+
--tag danonline/autopulse:${TAG_STABLE}-sqlite \
406+
ghcr.io/dan-online/autopulse:${TAG_STABLE}-sqlite
407+
fi
408+
372409
echo "Copy images over to Docker Hub..."
373410
# docker pull ${GHCR_BASE}:${TAG} -q
374411
# docker pull ${GHCR_BASE}:${TAG}-postgres -q

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ The easiest way to get started with autopulse is to use the provided docker imag
8484
- `latest` - full image with support for postgres/sqlite
8585
- `latest-postgres` - smaller image that only supports Postgres
8686
- `latest-sqlite` - smaller image that only supports SQLite
87+
- `stable` - latest versioned release
88+
8789
- `ui` - self-hostable UI for autopulse
8890

8991
> All images are multi-arch and support `linux/amd64`, `linux/arm64`, however -amd64 and -arm64 suffixes can be used to specify the architecture

0 commit comments

Comments
 (0)