-
Notifications
You must be signed in to change notification settings - Fork 52
64 lines (51 loc) · 2.21 KB
/
native-image-compile.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
name: native-image-compile
on: [push]
jobs:
native-image-compile-on-host:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache SDKMAN installation
uses: actions/cache@v3
with:
path: ~/.sdkman
key: ${{ runner.os }}-sdkman-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-sdkman-
- name: Install GraalVM with SDKMAN
run: |
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 21.2.0.r11-grl
java -version
- name: Install GraalVM Native Image
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
gu install native-image
native-image --version
- name: Install Maven, that uses GraalVM for later builds
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install maven
mvn --version
- name: Run GraalVM Native Image compilation of Spring Boot App (Maven version instead of ./compile.sh)
run: |
source "$HOME/.sdkman/bin/sdkman-init.sh"
mvn -B clean package -P native --no-transfer-progress
native-image-compile-in-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login into Heroku Container Registry first, so that we can push our Image later
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin registry.heroku.com
- name: Compile Native Image using Docker
run: docker build . --tag=registry.heroku.com/spring-boot-graal/web
- name: Push to Heroku Container Registry
run: docker push registry.heroku.com/spring-boot-graal/web
- name: Release Dockerized Native Spring Boot App on Heroku
run: ./heroku-release.sh spring-boot-graal
- name: Push to Docker Hub also, since automatic Builds there dont have anough RAM to do a docker build
run: |
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
docker tag registry.heroku.com/spring-boot-graal/web jonashackt/spring-boot-graalvm:latest
docker push jonashackt/spring-boot-graalvm:latest