-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest not linked to the highest version #80
Comments
This is the expected behavior if you maintain multiple versions. And indeed, this is not really wise in your case.
You can tell the action to only create latest for flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/v2.') }} Btw can you post your workflow or do you have a link to your repo please? |
Great! that's a good workaround. I confirm it's working.
I'm testing the workflow on my fork: name: Publish Docker images
on:
push:
tags:
- 'v*'
jobs:
main:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
xezpeleta/elkarbackup
ghcr.io/xezpeleta/elkarbackup
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# WARNING: releasing older versions will overwrite "latest" tag
# We can specify our preferred "latest" version manually in that case:
flavor: |
latest=${{ startsWith(github.ref, 'refs/tags/v2') }}
-
name: Set up Quemu
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }} Thank you very much |
mastodon#25803 was incorrect Fixes mastodon#25765 This comes from docker/metadata-action#80 (comment)
Behaviour
Steps to reproduce this issue
2.0.1
,2.0
,2
andlatest
1.9.1
,1.9
,1
andlatest
Expected behaviour
I want to have the "latest" tag always linked to the highest version (v2.0.1)
Actual behaviour
If I publish a revision of an older version (v1.9.1) it will overwrite the "latest" version.
Is this deliberate? Is there any workaround?
Thanks
The text was updated successfully, but these errors were encountered: