Skip to content

Commit 1283cbe

Browse files
committed
Link psychic action : maven container publish
1 parent edc34b1 commit 1283cbe

File tree

2 files changed

+22
-96
lines changed

2 files changed

+22
-96
lines changed

.github/workflows/docker_publish.yml

Lines changed: 10 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,16 @@ on:
1212
types: [published]
1313

1414
jobs:
15-
docker:
15+
build:
16+
name: Build
1617
runs-on: ubuntu-latest
1718
steps:
18-
- uses: actions/checkout@main
19+
- uses: fugerit-org/psychic-actions/maven-container-publish@mcp
1920
with:
20-
# Shallow clones should be disabled for a better relevancy of analysis
21-
fetch-depth: 0
22-
- name: Echo ref name trigger
23-
run: echo ${{ github.ref_name }}
24-
- name: Set up JDK 21
25-
uses: actions/setup-java@main
26-
with:
27-
java-version: '21'
28-
distribution: 'corretto'
29-
cache: 'maven'
30-
- name: Cache Maven packages
31-
uses: actions/cache@main
32-
with:
33-
path: ~/.m2
34-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
35-
restore-keys: ${{ runner.os }}-m2
36-
- name: Cache SonarCloud packages
37-
uses: actions/cache@main
38-
with:
39-
path: ~/.sonar/cache
40-
key: ${{ runner.os }}-sonar
41-
restore-keys: ${{ runner.os }}-sonar
42-
- name: Maven version
43-
run: mvn -v
44-
env:
45-
# Needed to get some information about the pull request, if any
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
48-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
49-
- name: Build and analyze
50-
run: mvn -B clean package
51-
# using action https://github.com/marketplace/actions/build-and-push-docker-images
52-
- name: Set up QEMU
53-
uses: docker/setup-qemu-action@master
54-
- name: Set up Docker Buildx
55-
uses: docker/setup-buildx-action@master
56-
- name: Login to Docker Hub
57-
uses: docker/login-action@master
58-
with:
59-
username: ${{ secrets.DOCKERHUB_USERNAME }}
60-
password: ${{ secrets.DOCKERHUB_TOKEN }}
61-
- name: Build and push
62-
uses: docker/build-push-action@master
63-
with:
64-
context: .
65-
file: src/main/docker/Dockerfile.corretto-jvm
66-
platforms: linux/amd64,linux/arm64
67-
push: true
68-
tags: fugeritorg/fj-daogen-quarkus-demo:${{ github.ref_name }},fugeritorg/fj-daogen-quarkus-demo:latest
21+
github-token: ${{ secrets.GITHUB_TOKEN }}
22+
docker-file: './src/main/docker/Dockerfile.corretto-jvm'
23+
docker-platforms: linux/amd64,linux/arm64
24+
docker-tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{github.event.repository.name}}:${{ github.ref_name }},${{ secrets.DOCKERHUB_USERNAME }}/${{github.event.repository.name}}:latest
25+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}
27+

.github/workflows/docker_publish_native_amd64.yml

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,19 @@ on:
1212
types: [published]
1313

1414
jobs:
15-
docker:
15+
build:
16+
name: Build
1617
runs-on: ubuntu-latest
1718
steps:
18-
19-
- uses: actions/checkout@main
20-
with:
21-
# Shallow clones should be disabled for a better relevancy of analysis
22-
fetch-depth: 0
23-
24-
- name: Echo ref name trigger
25-
run: echo ${{ github.ref_name }}
26-
27-
- uses: graalvm/setup-graalvm@main
19+
- uses: fugerit-org/psychic-actions/maven-container-publish@mcp
2820
with:
29-
java-version: '22-ea'
30-
distribution: 'graalvm'
3121
github-token: ${{ secrets.GITHUB_TOKEN }}
32-
native-image-job-reports: 'true'
33-
34-
- name: Cache Maven packages
35-
uses: actions/cache@main
36-
with:
37-
path: ~/.m2
38-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
39-
restore-keys: ${{ runner.os }}-m2
40-
41-
- name: Build and analyze
42-
run: mvn install -Dnative -Dquarkus.native.container-build=true
43-
44-
- name: Set up QEMU
45-
uses: docker/setup-qemu-action@master
46-
47-
- name: Set up Docker Buildx
48-
uses: docker/setup-buildx-action@master
49-
50-
- name: Login to Docker Hub
51-
uses: docker/login-action@master
52-
with:
53-
username: ${{ secrets.DOCKERHUB_USERNAME }}
54-
password: ${{ secrets.DOCKERHUB_TOKEN }}
55-
56-
- name: Build and push
57-
uses: docker/build-push-action@master
58-
with:
59-
context: .
60-
file: src/main/docker/Dockerfile.native-micro
61-
platforms: linux/amd64
62-
push: true
63-
tags: fugeritorg/fj-daogen-quarkus-demo:${{ github.ref_name }}-amd64native,fugeritorg/fj-daogen-quarkus-demo:latest-amd64native
22+
java-type: 'native'
23+
java-distribution: 'graalvm'
24+
java-version: '22-ea'
25+
maven-options: 'clean package -Dnative -Dquarkus.native.container-build=true'
26+
docker-file: './src/main/docker/Dockerfile.native-micro'
27+
docker-platforms: linux/amd64
28+
docker-tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{github.event.repository.name}}:${{ github.ref_name }}-amd64native,${{ secrets.DOCKERHUB_USERNAME }}/${{github.event.repository.name}}:latest-amd64native
29+
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}

0 commit comments

Comments
 (0)