23
23
- v*
24
24
workflow_dispatch :
25
25
26
+ env :
27
+ # Common versions
28
+ GO_VERSION : " 1.20"
29
+
26
30
jobs :
27
- build :
31
+ build-dockerhub :
28
32
runs-on : ubuntu-latest
29
33
steps :
30
- - name : Check out the repo
34
+ - name : Checkout
31
35
uses : actions/checkout@v3
32
-
33
- - name : Build OpenIM Server
34
- run : |
35
- sudo make build
36
+ - name : Set up QEMU
37
+ uses : docker/setup-qemu-action@v2
38
+ - name : Set up Docker Buildx
39
+ uses : docker/setup-buildx-action@v2
36
40
37
41
# docker.io/openim/openim-server:latest
38
42
- name : Extract metadata (tags, labels) for Docker
39
43
id : meta
40
44
uses : docker/metadata-action@v4.6.0
41
45
with :
42
46
images : openim/openim-server
47
+ # generate Docker tags based on the following events/attributes
48
+ tags : |
49
+ type=schedule
50
+ type=ref,event=branch
51
+ type=ref,event=pr
52
+ type=semver,pattern={{version}}
53
+ type=semver,pattern={{major}}.{{minor}}
54
+ type=semver,pattern={{major}}
55
+ type=sha
43
56
44
57
- name : Log in to Docker Hub
45
58
uses : docker/login-action@v2
@@ -51,10 +64,21 @@ jobs:
51
64
uses : docker/build-push-action@v4
52
65
with :
53
66
context : .
67
+ # linux/ppc64le,linux/s390x
68
+ platforms : linux/amd64,linux/arm64
54
69
push : ${{ github.event_name != 'pull_request' }}
55
70
tags : ${{ steps.meta.outputs.tags }}
56
71
labels : ${{ steps.meta.outputs.labels }}
57
72
73
+ build-aliyun :
74
+ runs-on : ubuntu-latest
75
+ steps :
76
+ - name : Checkout
77
+ uses : actions/checkout@v3
78
+ - name : Set up QEMU
79
+ uses : docker/setup-qemu-action@v2
80
+ - name : Set up Docker Buildx
81
+ uses : docker/setup-buildx-action@v2
58
82
# registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
59
83
- name : Extract metadata (tags, labels) for Docker
60
84
id : meta2
@@ -73,10 +97,21 @@ jobs:
73
97
uses : docker/build-push-action@v4
74
98
with :
75
99
context : .
100
+ # linux/ppc64le,linux/s390x
101
+ platforms : linux/amd64,linux/arm64
76
102
push : ${{ github.event_name != 'pull_request' }}
77
103
tags : ${{ steps.meta2.outputs.tags }}
78
104
labels : ${{ steps.meta2.outputs.labels }}
79
105
106
+ build-ghcr :
107
+ runs-on : ubuntu-latest
108
+ steps :
109
+ - name : Checkout
110
+ uses : actions/checkout@v3
111
+ - name : Set up QEMU
112
+ uses : docker/setup-qemu-action@v2
113
+ - name : Set up Docker Buildx
114
+ uses : docker/setup-buildx-action@v2
80
115
# ghcr.io/openimsdk/openim-server:latest
81
116
- name : Extract metadata (tags, labels) for Docker
82
117
id : meta3
@@ -88,13 +123,15 @@ jobs:
88
123
uses : docker/login-action@v2
89
124
with :
90
125
registry : ghcr.io
91
- username : ${{ github.actor }}
126
+ username : ${{ github.repository_owner }}
92
127
password : ${{ secrets.GITHUB_TOKEN }}
93
128
94
129
- name : Build and push Docker image
95
130
uses : docker/build-push-action@v4
96
131
with :
97
132
context : .
133
+ # linux/ppc64le,linux/s390x
134
+ platforms : linux/amd64,linux/arm64
98
135
push : ${{ github.event_name != 'pull_request' }}
99
136
tags : ${{ steps.meta3.outputs.tags }}
100
137
labels : ${{ steps.meta3.outputs.labels }}
0 commit comments