Skip to content

Commit 62826d3

Browse files
committed
Refactor pipelines for a more GH Actions building block design
1 parent c990753 commit 62826d3

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

.github/workflows/native-image-compile.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,49 @@ on: [push]
55
jobs:
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: Install GraalVM with SDKMAN
1312
run: |
14-
echo 'Install GraalVM with SDKMAN'
1513
curl -s "https://get.sdkman.io" | bash
1614
source "$HOME/.sdkman/bin/sdkman-init.sh"
1715
sdk install java 20.3.1.2.r11-grl
18-
19-
echo 'Check if GraalVM was installed successfully'
2016
java -version
2117
22-
echo 'Install GraalVM Native Image'
18+
- name: Install GraalVM Native Image
19+
run: |
2320
gu install native-image
24-
25-
echo 'Check if Native Image was installed properly'
2621
native-image --version
2722
28-
echo 'Install Maven, that uses GraalVM for later builds'
23+
- name: Install Maven, that uses GraalVM for later builds
24+
run: |
2925
source "$HOME/.sdkman/bin/sdkman-init.sh"
3026
sdk install maven
31-
32-
echo 'Show Maven using GraalVM JDK'
3327
mvn --version
3428
35-
echo 'Run GraalVM Native Image compilation of Spring Boot App (Maven version instead of ./compile.sh)'
36-
mvn -B clean package -P native --no-transfer-progress
29+
- name: Run GraalVM Native Image compilation of Spring Boot App (Maven version instead of ./compile.sh)
30+
run: mvn -B clean package -P native --no-transfer-progress
3731

3832
native-image-compile-in-docker:
3933
runs-on: ubuntu-latest
40-
4134
steps:
4235
- uses: actions/checkout@v2
4336

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
37+
- name: Login into Heroku Container Registry first, so that we can push our Image later
38+
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin registry.heroku.com
4839

49-
echo 'Compile Native Image using Docker'
50-
docker build . --tag=registry.heroku.com/spring-boot-graal/web
40+
- name: Compile Native Image using Docker
41+
run: docker build . --tag=registry.heroku.com/spring-boot-graal/web
5142

52-
echo 'Push to Heroku Container Registry'
53-
docker push registry.heroku.com/spring-boot-graal/web
43+
- name: Push to Heroku Container Registry
44+
run: docker push registry.heroku.com/spring-boot-graal/web
5445

55-
echo 'Release Dockerized Native Spring Boot App on Heroku'
56-
./heroku-release.sh spring-boot-graal
46+
- name: Release Dockerized Native Spring Boot App on Heroku
47+
run: ./heroku-release.sh spring-boot-graal
5748

58-
echo 'Push to Docker Hub also, since automatic Builds there dont have anough RAM to do a docker build'
49+
- name: Push to Docker Hub also, since automatic Builds there dont have anough RAM to do a docker build
50+
run: |
5951
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
6052
docker tag registry.heroku.com/spring-boot-graal/web jonashackt/spring-boot-graalvm:latest
6153
docker push jonashackt/spring-boot-graalvm:latest
62-
env:
63-
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

0 commit comments

Comments
 (0)