-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (47 loc) · 1.52 KB
/
workflow.yml
File metadata and controls
55 lines (47 loc) · 1.52 KB
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
52
53
54
55
name: Service Build
permissions:
contents: read
packages: write
on:
push:
branches: [ master ]
workflow_dispatch:
concurrency:
group: master-ci
cancel-in-progress: true
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
# 矩阵配置:列出所有需要打包的服务名
matrix:
service: [gateway, user, content, notify, im, signal, connector, infra]
# 即使一个服务失败,其他服务也继续构建
fail-fast: false
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
cache: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker Login (Aliyun & GHCR)
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login registry.cn-hangzhou.aliyuncs.com -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
file: common/Dockerfile
push: true
build-args: |
APP_NAME=${{ matrix.service }}
tags: |
registry.cn-hangzhou.aliyuncs.com/docker-cooooing/${{ matrix.service }}:latest
ghcr.io/cooooing/${{ matrix.service }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max