Skip to content

Commit

Permalink
Link psychic action : maven container publish
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Apr 21, 2024
1 parent edc34b1 commit 72d4218
Showing 1 changed file with 12 additions and 51 deletions.
63 changes: 12 additions & 51 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,18 @@ on:
types: [published]

jobs:
docker:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Get repo name
run: echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d '/' -f 2)" >> $GITHUB_ENV
- uses: fugerit-org/psychic-actions/maven-container-publish@1-action-for-maven-build-container-build-and-publish
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- name: Echo ref name trigger
run: echo ${{ github.ref_name }}
- name: Set up JDK 21
uses: actions/setup-java@main
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'
- name: Cache Maven packages
uses: actions/cache@main
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache SonarCloud packages
uses: actions/cache@main
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Maven version
run: mvn -v
env:
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SonarCloud access token should be generated from https://sonarcloud.io/account/security/
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build and analyze
run: mvn -B clean package
# using action https://github.com/marketplace/actions/build-and-push-docker-images
- name: Set up QEMU
uses: docker/setup-qemu-action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
- name: Login to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@master
with:
context: .
file: src/main/docker/Dockerfile.corretto-jvm
platforms: linux/amd64,linux/arm64
push: true
tags: fugeritorg/fj-daogen-quarkus-demo:${{ github.ref_name }},fugeritorg/fj-daogen-quarkus-demo:latest
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-file: './src/main/docker/Dockerfile.corretto-jvm'
docker-platforms: linux/amd64,linux/arm64
docker-tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}:${{ github.ref_name }},${{ secrets.DOCKERHUB_USERNAME }}/${{ env.REPO_NAME }}:latest
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }}

0 comments on commit 72d4218

Please sign in to comment.