-
Notifications
You must be signed in to change notification settings - Fork 2
117 lines (99 loc) · 2.89 KB
/
publish-server.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
---
# Automatically build and publish the server to the container registry.
# This workflow is triggered on changes to the server directory.
name: Build and Publish hmi-server
# yamllint disable-line rule:truthy
on:
push:
paths:
- 'packages/server/**'
branches:
- 'main'
tags:
- '*'
concurrency:
group: build-and-publish-hmi-server
cancel-in-progress: true
jobs:
image-tag:
name: Get tagged image name
uses: ./.github/workflows/image-tag.yml
with:
image-name: ghcr.io/darpa-askem/hmi-server
amd64:
runs-on: ubuntu-24.04
needs: image-tag
permissions:
contents: read
packages: write
steps:
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout the repository
uses: actions/checkout@v4
- name: Validate GradleW JAR
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java v17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Build hmi-server using Makefile
run: make image-hmi-server
- name: Create image and push
uses: docker/build-push-action@v5
with:
context: .
file: ./packages/server/docker/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--amd64
arm64-emulation:
runs-on: ubuntu-24.04
needs: image-tag
permissions:
contents: read
packages: write
steps:
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Checkout the repository
uses: actions/checkout@v4
- name: Validate GradleW JAR
uses: gradle/actions/wrapper-validation@v3
- name: Setup Java v17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Build hmi-server using Makefile
run: make image-hmi-server
- name: Create image and push
uses: docker/build-push-action@v5
with:
context: .
file: ./packages/server/docker/Dockerfile
platforms: linux/arm64
push: true
tags: ${{ needs.image-tag.outputs.tagged-image-name }}--arm64
merge-images:
name: Merge AMD64 and ARM64 images under one manifest
needs:
- image-tag
- amd64
- arm64-emulation
uses: ./.github/workflows/merge-images.yml
with:
name: ${{ needs.image-tag.outputs.tagged-image-name }}