1212 type : string
1313
1414jobs :
15- docker_idn :
16- name : Build and Push idn-node
15+ # Build idn-node for amd64 and arm64 in parallel, then create manifest
16+ build-idn-amd64 :
17+ name : Build idn-node (amd64)
1718 runs-on : ubuntu-latest
18-
1919 steps :
2020 - name : Free disk space
2121 run : |
2525 - name : Checkout
2626 uses : actions/checkout@v4
2727
28- - name : Set up QEMU
29- uses : docker/setup-qemu-action@v3
30-
3128 - name : Set up Docker Buildx
3229 uses : docker/setup-buildx-action@v3
3330
@@ -37,34 +34,90 @@ jobs:
3734 username : ${{ vars.DOCKERHUB_USERNAME }}
3835 password : ${{ secrets.DOCKERHUB_TOKEN }}
3936
40- - name : Extract metadata
41- id : meta
42- uses : docker/metadata-action@v5
37+ - name : Build and push
38+ uses : docker/build-push-action@v5
39+ with :
40+ context : .
41+ platforms : linux/amd64
42+ push : true
43+ tags : ideallabs/idn-node:${{ github.ref_name }}-amd64
44+ build-args : |
45+ NODE_PACKAGE=idn-node
46+ GIT_COMMIT=${{ github.sha }}
47+ cache-from : type=gha,scope=idn-amd64
48+ cache-to : type=gha,mode=max,scope=idn-amd64
49+
50+ build-idn-arm64 :
51+ name : Build idn-node (arm64)
52+ runs-on : ubuntu-24.04-arm
53+ steps :
54+ - name : Free disk space
55+ run : |
56+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
57+ sudo docker image prune --all --force
58+
59+ - name : Checkout
60+ uses : actions/checkout@v4
61+
62+ - name : Set up Docker Buildx
63+ uses : docker/setup-buildx-action@v3
64+
65+ - name : Log in to Docker Hub
66+ uses : docker/login-action@v3
4367 with :
44- images : ideallabs/idn-node
45- tags : |
46- type=semver,pattern={{version}}
47- type=semver,pattern={{major}}.{{minor}}
48- type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
68+ username : ${{ vars.DOCKERHUB_USERNAME }}
69+ password : ${{ secrets.DOCKERHUB_TOKEN }}
4970
5071 - name : Build and push
5172 uses : docker/build-push-action@v5
5273 with :
5374 context : .
54- platforms : linux/amd64,linux/ arm64
75+ platforms : linux/arm64
5576 push : true
56- tags : ${{ steps.meta.outputs.tags }}
57- labels : ${{ steps.meta.outputs.labels }}
77+ tags : ideallabs/idn-node:${{ github.ref_name }}-arm64
5878 build-args : |
5979 NODE_PACKAGE=idn-node
6080 GIT_COMMIT=${{ github.sha }}
61- cache-from : type=gha
62- cache-to : type=gha,mode=max
81+ cache-from : type=gha,scope=idn-arm64
82+ cache-to : type=gha,mode=max,scope=idn-arm64
6383
64- docker_idn_consumer :
65- name : Build and Push idn-consumer- node
84+ manifest-idn :
85+ name : Create idn-node manifest
6686 runs-on : ubuntu-latest
87+ needs : [build-idn-amd64, build-idn-arm64]
88+ steps :
89+ - name : Log in to Docker Hub
90+ uses : docker/login-action@v3
91+ with :
92+ username : ${{ vars.DOCKERHUB_USERNAME }}
93+ password : ${{ secrets.DOCKERHUB_TOKEN }}
6794
95+ - name : Create and push manifest
96+ run : |
97+ # Create manifest for version tag
98+ docker manifest create ideallabs/idn-node:${{ github.ref_name }} \
99+ ideallabs/idn-node:${{ github.ref_name }}-amd64 \
100+ ideallabs/idn-node:${{ github.ref_name }}-arm64
101+ docker manifest push ideallabs/idn-node:${{ github.ref_name }}
102+
103+ # Create manifest for latest tag
104+ docker manifest create ideallabs/idn-node:latest \
105+ ideallabs/idn-node:${{ github.ref_name }}-amd64 \
106+ ideallabs/idn-node:${{ github.ref_name }}-arm64
107+ docker manifest push ideallabs/idn-node:latest
108+
109+ # Extract major.minor version and create tag
110+ VERSION=${{ github.ref_name }}
111+ MAJOR_MINOR=$(echo $VERSION | sed -E 's/^v?([0-9]+\.[0-9]+).*/\1/')
112+ docker manifest create ideallabs/idn-node:$MAJOR_MINOR \
113+ ideallabs/idn-node:${{ github.ref_name }}-amd64 \
114+ ideallabs/idn-node:${{ github.ref_name }}-arm64
115+ docker manifest push ideallabs/idn-node:$MAJOR_MINOR
116+
117+ # Build idn-consumer-node for amd64 and arm64 in parallel, then create manifest
118+ build-consumer-amd64 :
119+ name : Build idn-consumer-node (amd64)
120+ runs-on : ubuntu-latest
68121 steps :
69122 - name : Free disk space
70123 run : |
74127 - name : Checkout
75128 uses : actions/checkout@v4
76129
77- - name : Set up QEMU
78- uses : docker/setup-qemu-action@v3
79-
80130 - name : Set up Docker Buildx
81131 uses : docker/setup-buildx-action@v3
82132
@@ -86,26 +136,82 @@ jobs:
86136 username : ${{ vars.DOCKERHUB_USERNAME }}
87137 password : ${{ secrets.DOCKERHUB_TOKEN }}
88138
89- - name : Extract metadata
90- id : meta
91- uses : docker/metadata-action@v5
139+ - name : Build and push
140+ uses : docker/build-push-action@v5
92141 with :
93- images : ideallabs/idn-consumer-node
94- tags : |
95- type=semver,pattern={{version}}
96- type=semver,pattern={{major}}.{{minor}}
97- type=raw,value=latest,enable=${{ github.ref_type == 'tag' }}
142+ context : .
143+ platforms : linux/amd64
144+ push : true
145+ tags : ideallabs/idn-consumer-node:${{ github.ref_name }}-amd64
146+ build-args : |
147+ NODE_PACKAGE=idn-consumer-node
148+ GIT_COMMIT=${{ github.sha }}
149+ cache-from : type=gha,scope=consumer-amd64
150+ cache-to : type=gha,mode=max,scope=consumer-amd64
151+
152+ build-consumer-arm64 :
153+ name : Build idn-consumer-node (arm64)
154+ runs-on : ubuntu-24.04-arm
155+ steps :
156+ - name : Free disk space
157+ run : |
158+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
159+ sudo docker image prune --all --force
160+
161+ - name : Checkout
162+ uses : actions/checkout@v4
163+
164+ - name : Set up Docker Buildx
165+ uses : docker/setup-buildx-action@v3
166+
167+ - name : Log in to Docker Hub
168+ uses : docker/login-action@v3
169+ with :
170+ username : ${{ vars.DOCKERHUB_USERNAME }}
171+ password : ${{ secrets.DOCKERHUB_TOKEN }}
98172
99173 - name : Build and push
100174 uses : docker/build-push-action@v5
101175 with :
102176 context : .
103- platforms : linux/amd64,linux/ arm64
177+ platforms : linux/arm64
104178 push : true
105- tags : ${{ steps.meta.outputs.tags }}
106- labels : ${{ steps.meta.outputs.labels }}
179+ tags : ideallabs/idn-consumer-node:${{ github.ref_name }}-arm64
107180 build-args : |
108181 NODE_PACKAGE=idn-consumer-node
109182 GIT_COMMIT=${{ github.sha }}
110- cache-from : type=gha
111- cache-to : type=gha,mode=max
183+ cache-from : type=gha,scope=consumer-arm64
184+ cache-to : type=gha,mode=max,scope=consumer-arm64
185+
186+ manifest-consumer :
187+ name : Create idn-consumer-node manifest
188+ runs-on : ubuntu-latest
189+ needs : [build-consumer-amd64, build-consumer-arm64]
190+ steps :
191+ - name : Log in to Docker Hub
192+ uses : docker/login-action@v3
193+ with :
194+ username : ${{ vars.DOCKERHUB_USERNAME }}
195+ password : ${{ secrets.DOCKERHUB_TOKEN }}
196+
197+ - name : Create and push manifest
198+ run : |
199+ # Create manifest for version tag
200+ docker manifest create ideallabs/idn-consumer-node:${{ github.ref_name }} \
201+ ideallabs/idn-consumer-node:${{ github.ref_name }}-amd64 \
202+ ideallabs/idn-consumer-node:${{ github.ref_name }}-arm64
203+ docker manifest push ideallabs/idn-consumer-node:${{ github.ref_name }}
204+
205+ # Create manifest for latest tag
206+ docker manifest create ideallabs/idn-consumer-node:latest \
207+ ideallabs/idn-consumer-node:${{ github.ref_name }}-amd64 \
208+ ideallabs/idn-consumer-node:${{ github.ref_name }}-arm64
209+ docker manifest push ideallabs/idn-consumer-node:latest
210+
211+ # Extract major.minor version and create tag
212+ VERSION=${{ github.ref_name }}
213+ MAJOR_MINOR=$(echo $VERSION | sed -E 's/^v?([0-9]+\.[0-9]+).*/\1/')
214+ docker manifest create ideallabs/idn-consumer-node:$MAJOR_MINOR \
215+ ideallabs/idn-consumer-node:${{ github.ref_name }}-amd64 \
216+ ideallabs/idn-consumer-node:${{ github.ref_name }}-arm64
217+ docker manifest push ideallabs/idn-consumer-node:$MAJOR_MINOR
0 commit comments