63 lines
1.4 KiB
YAML
63 lines
1.4 KiB
YAML
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 -u drone -p $PASSWORD
|
|
- tag=$${DRONE_TAG:-$DRONE_BRANCH} # set tag to tag name (if applicable) or branch name
|
|
- 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 -u drone -p $PASSWORD
|
|
- task push TAG=main
|
|
when:
|
|
branch:
|
|
- main
|
|
|
|
volumes:
|
|
- name: dockersocket
|
|
host:
|
|
path: /var/run/docker.sock
|
|
- name: docker
|
|
temp: {}
|
|
|
|
image_pull_secrets:
|
|
- dockerconfig |