-
Notifications
You must be signed in to change notification settings - Fork 0
230 lines (227 loc) · 8.74 KB
/
ubuntu.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: ubuntu buiding
on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'
schedule:
- cron: "0 3 * * *"
env:
TEST_COMPLIE: yunnysunny/node-compiler:latest
TEST_RUNTIME: yunnysunny/node-runtime:latest
jobs:
docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- node-version: 16.20.2
major-version: 16
- node-version: 18.19.0
major-version: 18
- node-version: 20.10.0
major-version: 20
latest: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker meta for core on node ${{ matrix.node-version }}
id: meta-core
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/node
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for compiler
id: meta-compiler
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/node-compiler
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for xtransit
id: meta-xtransit
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/node-xtransit
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Docker meta for easy-monitor
id: meta-easy-monitor
uses: docker/metadata-action@v4
with:
images: |
yunnysunny/easy-monitor
tags: |
type=semver,pattern={{version}},value=v${{matrix.node-version}}
type=semver,pattern={{major}}.{{minor}},value=v${{matrix.node-version}}
type=semver,pattern={{major}},value=v${{matrix.node-version}}
flavor: |
latest=${{matrix.latest || 'false'}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build core
uses: docker/build-push-action@v3
with:
context: core
push: false
tags: yunnysunny/node:latest
file: node.dockerfile
target: core
cache-from: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
load: true
- name: Build compiler
uses: docker/build-push-action@v3
with:
context: compiler
push: false
tags: ${{ env.TEST_COMPLIE }}
file: node.dockerfile
target: compiler
cache-from: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
load: true
- name: Build xtransit
uses: docker/build-push-action@v3
with:
context: xtransit
build-args: |
NODE_VERSION=${{matrix.node-version}}
push: false
target: xtransit
cache-from: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}},mode=max
tags: ${{ env.TEST_RUNTIME }}
file: node.dockerfile
load: true
# - name: Test hello
# run: |
# cd test/hello && ./test.sh
- uses: docker/build-push-action@v2
with:
tags: test-image:latest
context: test/hello
build-args: |
IMAGE_VERSION=latest
file: test/hello/Dockerfile
push: false
load: true
- uses: addnab/docker-run-action@v3
with:
image: test-image:latest
run: |
node src/app.js &
whoami
ps -ef | grep node
pldd $(ps -ef | grep node | grep -v grep | awk '{print $2}') || true
sudo ps -ef | grep node || true
- name: Build and push core
uses: docker/build-push-action@v3
with:
context: core
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-core.outputs.tags }}
labels: ${{ steps.meta-core.outputs.labels }}
target: core
cache-from: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push compiler
uses: docker/build-push-action@v3
with:
context: core
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-compiler.outputs.tags }}
labels: ${{ steps.meta-compiler.outputs.labels }}
target: compiler
cache-from: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-compiler:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push compiler
uses: docker/build-push-action@v3
with:
context: easy-monitor
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-easy-monitor.outputs.tags }}
labels: ${{ steps.meta-easy-monitor.outputs.labels }}
target: ezm-runtime
cache-from: type=registry,ref=yunnysunny/easy-monitor:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/easy-monitor:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Build and push xtransit
uses: docker/build-push-action@v3
with:
context: xtransit
platforms: linux/amd64,linux/arm64
file: node.dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-xtransit.outputs.tags }}
labels: ${{ steps.meta-xtransit.outputs.labels }}
target: xtransit
cache-from: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}}
cache-to: type=registry,ref=yunnysunny/node-xtransit:buildcache-${{matrix.major-version}},mode=max
build-args: |
NODE_VERSION=${{matrix.node-version}}
- name: Update core description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/node
- name: Update compiler description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/node-compiler
- name: Update rumtime description
uses: peter-evans/dockerhub-description@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: yunnysunny/node-xtransit