hehe
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-06-10 04:24:46 +09:00
parent ba2f9bdf0e
commit 5ec4d2dbd3

View File

@ -4,15 +4,39 @@ name: default
steps:
- name: 打包 Docker 容器
image: plugins/docker
settings:
username:
image: docker:latest
privileged: true
environment:
DOCKER_TAG: ${DRONE_COMMIT_SHA:0:8}
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
password:
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
repo: gitea.service.jazzwhom.top/kagami-public
tags:
- latest
DOCKER_REGISTRY: gitea.service.jazzwhom.top
volumes:
- name: /var/run/docker.sock
path: /var/run/docker.sock
commands:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin "$DOCKER_REGISTRY"
- docker build -t "$DOCKER_REGISTRY/your-org/your-app:$DOCKER_TAG" .
- docker build -t "$DOCKER_REGISTRY/your-org/your-app:latest" .
- docker push "$DOCKER_REGISTRY/your-org/your-app:$DOCKER_TAG"
- docker push "$DOCKER_REGISTRY/your-org/your-app:latest"
- name: 清理累赘的 Docker 镜像
image: docker:latest
privileged: true
volumes:
- name: /var/run/docker.sock
path: /var/run/docker.sock
commands:
- docker rmi "$DOCKER_REGISTRY/your-org/your-app:$DOCKER_TAG"
- docker rmi "$DOCKER_REGISTRY/your-org/your-app:latest"
when:
status:
- success
- failure
trigger:
event: