-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.49 KB
/
caddy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: 构建 Caddy 镜像
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-24.04
strategy:
matrix:
dist: ["trojan", "cloudflare-dns"]
steps:
- name: 签出代码
uses: actions/checkout@v4
- name: 登录腾讯云容器镜像服务
uses: docker/login-action@v3
with:
registry: ccr.ccs.tencentyun.com
username: ${{ secrets.TENCENT_REGISTRY_USERNAME }}
password: ${{ secrets.TENCENT_REGISTRY_PASSWORD }}
- name: 登录 Docker 官方容器镜像服务
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
- name: 设置 Docker Buildx
uses: docker/setup-buildx-action@v3
- name: 缓存 Docker 构建层
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx
- name: 构建镜像
run: |
docker buildx build \
--file caddy/Dockerfile.${{ matrix.dist }} \
--label image.source=Caddy镜像 \
--label image.author=github.com/YangRucheng \
--platform linux/amd64,linux/arm64 \
--tag ccr.ccs.tencentyun.com/misaka-public/caddy:${{ matrix.dist }} \
--tag docker.io/yangrucheng/caddy:${{ matrix.dist }} \
--push .