-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Description
It is not uncommon to use the metadata-action. E.g.
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
flavor: |
latest=autoThe idea of this is to generate the correct tag (if we are pushing a tag, otherwise a different tag gets created).
In such a case, how do we supply the image?
The build-and-push docker action uses the tag as
tags: ${{ steps.meta.outputs.tags }}which in the end, is sensible if we where intended to run a pushed container
uses: addnab/docker-run-action@v3
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
run: |But this is obviously wrong, so then how can we use this action? Two scenario's are to be thought of. Upon pushing of a tag, where the container is also pushed into the ghcr, which is fine, and 'all other cases' e.g. pushes to master, pushes to a branch etc. How does this work, without pushing to ghcr and without using a fixed tag. (unless the answer is to always 'also' add a fixed tag, however that is done ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels