-
Notifications
You must be signed in to change notification settings - Fork 10
76 lines (65 loc) · 1.93 KB
/
github-actions-spring-boot-webserver.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
name: Multi-Cloud Apps with GraalVM - Up and Running
on:
push:
paths:
- 'native-image/spring-boot-webserver/**'
- '.github/workflows/github-actions-spring-boot-webserver.yml'
jobs:
build:
name: Run Jwebserver
runs-on: ubuntu-20.04 # Docker changed its behavior on Ubuntu 22.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '23'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Spring Boot Web Server
run: |
# Prepapre static resources
unzip native-image/spring-boot-webserver/src/main/resources/static.zip
cd ../../..
pwd
#
# Build JAR (Debian Slim)
./build-jar.sh
#
# Build Jlink custom runtime (Distroless Java Base)
./build-jlink.sh
#
# Build dynamic image (Distroless Java Base)
./build-dynamic-image.sh
#
# Build dynamic image, optimized for size (Distroless Java Base)
./build-dynamic-image-optimized.sh
#
# Setup musl toolchain
./setup-musl.sh
export PATH="$PWD/musl-toolchain/bin:$PATH"
#
# Build mostly static image (Distroless Base)
./build-mostly-static-image.sh
#
# Build fully static image (Scratch)
./build-static-image.sh
#
# Download upx
./setup-upx.sh
#
# Build fully static compressed image (Scratch UPX)
./build-static-upx-image.sh
#
# Compare file sizes
ls -lh target/webserver*
docker images webserver
# Restore defaults
git clean -fd static/
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: native-binaries-${{ matrix.os }}
path: |
target/webserver*