-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (84 loc) · 3.28 KB
/
main.yml
File metadata and controls
98 lines (84 loc) · 3.28 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
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
name: Manual Multi-Arch Native Build
on:
workflow_dispatch:
inputs:
version:
description: 'Image version (e.g., 1.0.0)'
required: true
default: 'latest'
jobs:
build:
name: Build Native Image
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
arch: amd64
- os: ubuntu-24.04-arm
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
cache-read-only: false
- name: Cache Node and NPM dependencies
uses: actions/cache@v4
with:
path: |
server/src/main/webui/node_modules
key: ${{ runner.os }}-${{ matrix.arch }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-node-
- name: Make gradlew executable
run: chmod +x gradlew
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# This will fail due to the front-end build missing files.
# The next step will generate these files.
# This order is necessary since this step will generate the openapi-spec.
- name: Quarkus App Parts Build
run: ./gradlew :server:quarkusAppPartsBuild "-Pversion=${{ github.event.inputs.version }}"
continue-on-error: true
- name: Generate OpenAPI
run: ./gradlew :server:openApiGenerate "-Pversion=${{ github.event.inputs.version }}"
- name: Build and Push Arch-Specific Image
run: |
./gradlew :server:build \
"-Pversion=${{ github.event.inputs.version }}" \
"-Dquarkus.native.container-build=true" \
"-Dquarkus.container-image.builder=docker" \
"-Dquarkus.native.enabled=true" \
"-Dquarkus.package.jar.enabled=false" \
"-Dquarkus.container-image.build=true" \
"-Dquarkus.container-image.push=true" \
"-Dquarkus.container-image.group=bethibande" \
"-Dquarkus.container-image.name=repository" \
"-Dquarkus.container-image.tag=${{ github.event.inputs.version }}-${{ matrix.arch }}"
create-manifest:
needs: build
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create and Push Multi-Arch Manifest
run: |
docker buildx imagetools create -t bethibande/repository:${{ github.event.inputs.version }} \
bethibande/repository:${{ github.event.inputs.version }}-amd64 \
bethibande/repository:${{ github.event.inputs.version }}-arm64
# Create the latest tag
docker buildx imagetools create -t bethibande/repository:latest \
bethibande/repository:${{ github.event.inputs.version }}-amd64 \
bethibande/repository:${{ github.event.inputs.version }}-arm64