Skip to content
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

Push only latest tag #440

Closed
AlessandroMinoccheri opened this issue Mar 18, 2023 · 0 comments
Closed

Push only latest tag #440

AlessandroMinoccheri opened this issue Mar 18, 2023 · 0 comments

Comments

@AlessandroMinoccheri
Copy link

Behaviour

I would like to push to docker the current tag not the "latest" name tag when a new release is done.

Steps to reproduce this issue

I have this github action:

publish_docker_images:
    needs: [update-version]
    runs-on: ubuntu-20.04
       
    if: github.ref == 'refs/heads/main' || github.event_name == 'release'
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Docker meta
      id: meta
      uses: crazy-max/ghaction-docker-meta@v2
      with:
        images: phparkitect/arkitect-github-actions
        tags: |
          type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') }}
          type=ref,event=tag
        flavor: |
          latest=false
    - name: Login to DockerHub
      if: github.event_name != 'pull_request'
      uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}
    - name: Build and push
      uses: docker/build-push-action@v2
      with:
        context: .
        push: ${{ github.event_name != 'pull_request' }}
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}

Expected behaviour

I would like to see the actual tag in docker hub

Actual behaviour

In docker hub I can see only the "latest" tag

Configuration

publish_docker_images:
    needs: [update-version]
    runs-on: ubuntu-20.04
       
    if: github.ref == 'refs/heads/main' || github.event_name == 'release'
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Docker meta
      id: meta
      uses: crazy-max/ghaction-docker-meta@v2
      with:
        images: phparkitect/arkitect-github-actions
        tags: |
          type=raw,value=latest,enable=${{ endsWith(github.ref, 'main') }}
          type=ref,event=tag
        flavor: |
          latest=false
    - name: Login to DockerHub
      if: github.event_name != 'pull_request'
      uses: docker/login-action@v1
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_TOKEN }}
    - name: Build and push
      uses: docker/build-push-action@v2
      with:
        context: .
        push: ${{ github.event_name != 'pull_request' }}
        tags: ${{ steps.meta.outputs.tags }}
        labels: ${{ steps.meta.outputs.labels }}

Logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant