# Docker plugin only push tags

**URL:** <https://drone.discourse.group/t/docker-plugin-only-push-tags/8576>\
**Category:** Drone Support\
**Created:** [February 18, 2021, 10:53pm UTC](https://drone.discourse.group/t/docker-plugin-only-push-tags/8576 "2021-02-18T22:53:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![inmanturbo](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/inmanturbo/32/2987_2.png) [@inmanturbo](https://drone.discourse.group/u/inmanturbo)\
**Post date:** [February 18, 2021, 10:53pm UTC](https://drone.discourse.group/t/docker-plugin-only-push-tags/8576/1 "2021-02-18T22:53:47Z")

</div>

Hello I’m trying to figure out how to push an image only if there is a release tag. In other words I want to run the docker build every commit to master but only want to push the image to the registry on certain events, how might I accomplish this? I’m sure it’s very simple but I can’t find it in the docs.

```auto
kind: pipeline
name: ci
type: kubernetes
steps:
- name: build_and_push
  image: plugins/docker
  settings:
    dockerfile: docker/7.4/Dockerfile
    build_args:
      - WWW_GROUP=www-data
    auto_tag: true
    auto_tag_suffix: ubuntu20.04-amd64-php7.4
    registry: harbor-harbor-registry.harbor.svc.cluster.local:5000
    insecure: true
    username:
      from_secret: HARBOR_USER
    password:
      from_secret: HARBOR_PASS
    repo: harbor-harbor-registry.harbor.svc.cluster.local:5000/project/repo

```

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [February 18, 2021, 11:06pm UTC](https://drone.discourse.group/t/docker-plugin-only-push-tags/8576/2 "2021-02-18T23:06:48Z")

</div>

Drone supports conditional steps (e.g. only execute this step if the event type is tag). See [https://docs.drone.io/pipeline/docker/syntax/conditions/](https://docs.drone.io/pipeline/docker/syntax/conditions/)
