@@ -5,59 +5,60 @@ on: [push]
55jobs :
66 native-image-compile-on-host :
77 runs-on : ubuntu-latest
8-
98 steps :
109 - uses : actions/checkout@v2
1110
12- - name : Install GraalVM, Maven, Native Image & Run Maven build
11+ - name : Cache SDKMAN installation
12+ uses : actions/cache@v2
13+ with :
14+ path : ~/.sdkman
15+ key : ${{ runner.os }}-sdkman-${{ hashFiles('**/pom.xml') }}
16+ restore-keys : |
17+ ${{ runner.os }}-sdkman-
18+
19+ - name : Install GraalVM with SDKMAN
1320 run : |
14- echo 'Install GraalVM with SDKMAN'
1521 curl -s "https://get.sdkman.io" | bash
1622 source "$HOME/.sdkman/bin/sdkman-init.sh"
1723 sdk install java 20.3.1.2.r11-grl
18-
19- echo 'Check if GraalVM was installed successfully'
2024 java -version
2125
22- echo 'Install GraalVM Native Image'
26+ - name : Install GraalVM Native Image
27+ run : |
28+ source "$HOME/.sdkman/bin/sdkman-init.sh"
2329 gu install native-image
24-
25- echo 'Check if Native Image was installed properly'
2630 native-image --version
2731
28- echo 'Install Maven, that uses GraalVM for later builds'
32+ - name : Install Maven, that uses GraalVM for later builds
33+ run : |
2934 source "$HOME/.sdkman/bin/sdkman-init.sh"
3035 sdk install maven
31-
32- echo 'Show Maven using GraalVM JDK'
3336 mvn --version
3437
35- echo 'Run GraalVM Native Image compilation of Spring Boot App (Maven version instead of ./compile.sh)'
38+ - name : Run GraalVM Native Image compilation of Spring Boot App (Maven version instead of ./compile.sh)
39+ run : |
40+ source "$HOME/.sdkman/bin/sdkman-init.sh"
3641 mvn -B clean package -P native --no-transfer-progress
3742
3843 native-image-compile-in-docker :
3944 runs-on : ubuntu-latest
40-
4145 steps :
4246 - uses : actions/checkout@v2
4347
44- - name : Build Native Image with Docker and Release to Heroku & Docker Hub
45- run : |
46- echo 'Login into Heroku Container Registry first, so that we can push our Image later'
47- echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin registry.heroku.com
48+ - name : Login into Heroku Container Registry first, so that we can push our Image later
49+ run : echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin registry.heroku.com
4850
49- echo ' Compile Native Image using Docker'
50- docker build . --tag=registry.heroku.com/spring-boot-graal/web
51+ - name : Compile Native Image using Docker
52+ run : docker build . --tag=registry.heroku.com/spring-boot-graal/web
5153
52- echo ' Push to Heroku Container Registry'
53- docker push registry.heroku.com/spring-boot-graal/web
54+ - name : Push to Heroku Container Registry
55+ run : docker push registry.heroku.com/spring-boot-graal/web
5456
55- echo ' Release Dockerized Native Spring Boot App on Heroku'
56- ./heroku-release.sh spring-boot-graal
57+ - name : Release Dockerized Native Spring Boot App on Heroku
58+ run : ./heroku-release.sh spring-boot-graal
5759
58- echo 'Push to Docker Hub also, since automatic Builds there dont have anough RAM to do a docker build'
60+ - name : Push to Docker Hub also, since automatic Builds there dont have anough RAM to do a docker build
61+ run : |
5962 echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
6063 docker tag registry.heroku.com/spring-boot-graal/web jonashackt/spring-boot-graalvm:latest
6164 docker push jonashackt/spring-boot-graalvm:latest
62- env :
63- DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
0 commit comments