Docker workflow: add labels and caching, push to GHCR #749
+40
β15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've reworked the Docker workflow a little. I started just planning to add a push to GHCR, then the rest happened π
v3.0.4would have tagslatest,v3.0.4,3.0.4,3.0,3).docker/build-push-action, but I didn't want to make this too disruptive.I ran some simple tests using act to see what the results of the
docker/metadata-actionwould look like for each trigger.The results look good as far as I'm concerned, however this does break the
workflow_dispatchtrigger insofar as no tags are generated for such events. As far as I can see this shouldn't be necessary, but I'm not sure specifically how, or even if you were using this trigger before, so let me know if this is a problem for you.schedule:{ "tags": [ "tigattack/scanservjs:staging", "ghcr.io/tigattack/scanservjs:staging" ], "labels": { "org.opencontainers.image.created": "2025-03-12T16:16:54.031Z", "org.opencontainers.image.description": "SANE scanner nodejs web ui", "org.opencontainers.image.licenses": "GPL-2.0", "org.opencontainers.image.revision": "8d0588f6c5886ed3783853d06ece36b834c3d61f", "org.opencontainers.image.source": "https://github.com/tigattack/scanservjs", "org.opencontainers.image.title": "scanservjs", "org.opencontainers.image.url": "https://github.com/tigattack/scanservjs", "org.opencontainers.image.version": "staging" }, "annotations": [ "manifest:org.opencontainers.image.created=2025-03-12T16:16:54.031Z", "manifest:org.opencontainers.image.description=SANE scanner nodejs web ui", "manifest:org.opencontainers.image.licenses=GPL-2.0", "manifest:org.opencontainers.image.revision=8d0588f6c5886ed3783853d06ece36b834c3d61f", "manifest:org.opencontainers.image.source=https://github.com/tigattack/scanservjs", "manifest:org.opencontainers.image.title=scanservjs", "manifest:org.opencontainers.image.url=https://github.com/tigattack/scanservjs", "manifest:org.opencontainers.image.version=staging" ] }releasetrigger with mocked event data:{ "tags": [ "tigattack/scanservjs:v3.0.4", "tigattack/scanservjs:3.0.4", "tigattack/scanservjs:3.0", "tigattack/scanservjs:3", "tigattack/scanservjs:latest", "ghcr.io/tigattack/scanservjs:v3.0.4", "ghcr.io/tigattack/scanservjs:3.0.4", "ghcr.io/tigattack/scanservjs:3.0", "ghcr.io/tigattack/scanservjs:3", "ghcr.io/tigattack/scanservjs:latest" ], "labels": { "org.opencontainers.image.created": "2025-03-12T16:16:21.098Z", "org.opencontainers.image.description": "SANE scanner nodejs web ui", "org.opencontainers.image.licenses": "GPL-2.0", "org.opencontainers.image.revision": "8d0588f6c5886ed3783853d06ece36b834c3d61f", "org.opencontainers.image.source": "https://github.com/tigattack/scanservjs", "org.opencontainers.image.title": "scanservjs", "org.opencontainers.image.url": "https://github.com/tigattack/scanservjs", "org.opencontainers.image.version": "v3.0.4" }, "annotations": [ "manifest:org.opencontainers.image.created=2025-03-12T16:16:21.098Z", "manifest:org.opencontainers.image.description=SANE scanner nodejs web ui", "manifest:org.opencontainers.image.licenses=GPL-2.0", "manifest:org.opencontainers.image.revision=8d0588f6c5886ed3783853d06ece36b834c3d61f", "manifest:org.opencontainers.image.source=https://github.com/tigattack/scanservjs", "manifest:org.opencontainers.image.title=scanservjs", "manifest:org.opencontainers.image.url=https://github.com/tigattack/scanservjs", "manifest:org.opencontainers.image.version=v3.0.4" ] }The event mock data looked like this:
{ "action": "created", "release": { "tag_name": "v3.0.4" } }workflow_dispatch:{ "tags": [], "labels": { "org.opencontainers.image.created": "2025-03-12T16:24:36.661Z", "org.opencontainers.image.description": "SANE scanner nodejs web ui", "org.opencontainers.image.licenses": "GPL-2.0", "org.opencontainers.image.revision": "8d0588f6c5886ed3783853d06ece36b834c3d61f", "org.opencontainers.image.source": "https://github.com/tigattack/scanservjs", "org.opencontainers.image.title": "scanservjs", "org.opencontainers.image.url": "https://github.com/tigattack/scanservjs", "org.opencontainers.image.version": "" }, "annotations": [ "manifest:org.opencontainers.image.created=2025-03-12T16:24:36.661Z", "manifest:org.opencontainers.image.description=SANE scanner nodejs web ui", "manifest:org.opencontainers.image.licenses=GPL-2.0", "manifest:org.opencontainers.image.revision=8d0588f6c5886ed3783853d06ece36b834c3d61f", "manifest:org.opencontainers.image.source=https://github.com/tigattack/scanservjs", "manifest:org.opencontainers.image.title=scanservjs", "manifest:org.opencontainers.image.url=https://github.com/tigattack/scanservjs", "manifest:org.opencontainers.image.version=" ] }