kind: pipeline type: docker name: ci steps: - name: build image: code.jhot.me/drone-users/drone-builder-image:main volumes: - name: docker path: /var/lib/docker - name: dockersocket path: /var/run/docker.sock commands: - task setup-buildx BUILDER_NAME=builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - task build TAG=$tag # build the docker image - name: publish tag image: code.jhot.me/drone-users/drone-builder-image:main depends_on: - build environment: PASSWORD: from_secret: FORGEJO_PASSWORD volumes: - name: docker path: /var/lib/docker - name: dockersocket path: /var/run/docker.sock commands: - docker login code.jhot.me -u jhot -p $PASSWORD - tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name - task setup-buildx BUILDER_NAME=builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} - task push TAG=$tag when: event: - tag - name: publish main image: code.jhot.me/drone-users/drone-builder-image:main depends_on: - build environment: PASSWORD: from_secret: FORGEJO_PASSWORD volumes: - name: docker path: /var/lib/docker - name: dockersocket path: /var/run/docker.sock commands: - docker login code.jhot.me -u jhot -p $PASSWORD - task setup-buildx BUILDER_NAME=builder${DRONE_COMMIT_SHA}${DRONE_BUILD_NUMBER} - task push TAG=main when: branch: - main volumes: - name: dockersocket host: path: /var/run/docker.sock - name: docker temp: {} image_pull_secrets: - dockerconfig