kind: pipeline
type: kubernetes
name: default
metadata:
  namespace: git
concurrency:
  limit: 1
steps:
  - name: build
    image: docker
    privileged: true
    environment:
      TOKEN:
        from_secret: gitea
      TOKEN_DOCKER:
        from_secret: docker_hub
    commands:
      - dockerd &
      - docker login -u voidic -p $TOKEN_DOCKER
      - docker buildx build --push -t voidic/route96:latest .
      - kill $(cat /var/run/docker.pid)
---
kind: pipeline
type: kubernetes
name: docker-tagged
concurrency:
  limit: 1
trigger:
  event:
    - tag
metadata:
  namespace: git
steps:
  - name: build
    image: docker
    privileged: true
    environment:
      TOKEN:
        from_secret: gitea
      TOKEN_DOCKER:
        from_secret: docker_hub
    commands:
      - dockerd &
      - docker login -u voidic -p $TOKEN_DOCKER
      - docker buildx build --push voidic/route96:$DRONE_TAG .
      - kill $(cat /var/run/docker.pid)