Hexo-Async-Offends/.drone.yml

162 lines
3.3 KiB
YAML
Raw Normal View History

2024-07-19 07:19:56 +00:00
kind: pipeline
type: docker
name: Synchronization Nginx-Images
trigger:
event:
include:
- custom
node:
drone: abroad
steps:
- name: 同步 Nginx-Images
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
REGISTRY:
from_secret: REGISTRY
REPO:
from_secret: REPO
BUILD:
from_secret: BUILD
commands:
- |
docker pull nginx:alpine-slim \
&& docker login $REGISTRY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD \
&& docker tag nginx:alpine-slim $REPO:nginx-alpine-slim \
&& docker push $REPO:nginx-alpine-slim
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
kind: pipeline
type: docker
name: Synchronization Twikoo-Images
trigger:
event:
include:
- custom
steps:
- name: 同步 Twikoo-Images
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
REGISTRY:
from_secret: REGISTRY
REPO:
from_secret: REPO
BUILD:
from_secret: BUILD
commands:
- |
docker pull imaegoo/twikoo:latest \
&& docker login $REGISTRY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD \
&& docker tag imaegoo/twikoo:latest $REPO:twikoo \
&& docker push $REPO:twikoo
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
kind: pipeline
type: docker
name: Build Hexo-Images
trigger:
event:
include:
- custom
steps:
- name: 同步 Node-Alpine-Image
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
environment:
DOCKER_USERNAME:
from_secret: DOCKER_USERNAME
DOCKER_PASSWORD:
from_secret: DOCKER_PASSWORD
REGISTRY:
from_secret: REGISTRY
REPO:
from_secret: REPO
BUILD:
from_secret: BUILD
commands:
- |
docker pull node:alpine \
&& docker login $REGISTRY -u $DOCKER_USERNAME -p $DOCKER_PASSWORD \
&& docker tag node:alpine $REPO:node-alpine \
&& docker push $REPO:node-alpine
- name: Build Hexo-Images
image: plugins/docker
# 仅当本地不存在该镜像时才拉取
# pull: if-not-exists
settings:
registry:
from_secret: REGISTRY
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
repo:
from_secret: REPO
# 是否禁止推送镜像
dry_run: false
tags:
- hexo
context: ./
dockerfile: ./Dockerfile-hexo
build_args:
- IMAGENAME=registry.cn-hangzhou.aliyuncs.com/offends/hexo:node-alpine
when:
branch:
- main
- name: Build Hexo-Async-Images
image: plugins/docker
# 仅当本地不存在该镜像时才拉取
# pull: if-not-exists
settings:
registry:
from_secret: REGISTRY
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
repo:
from_secret: REPO
# 是否禁止推送镜像
dry_run: false
tags:
- hexo-async
context: ./
dockerfile: ./Dockerfile-hexo-async
build_args:
- IMAGENAME=registry.cn-hangzhou.aliyuncs.com/offends/hexo:hexo
when:
branch:
- main
volumes:
- name: dockersock
host:
path: /var/run/docker.sock