Skip to content

Pogues Back Office Docker CI #83

Pogues Back Office Docker CI

Pogues Back Office Docker CI #83

Workflow file for this run

name: Pogues Back Office Docker CI
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Test, package and analyze with maven & SonarCloud
run: mvn --no-transfer-progress verify sonar:sonar -Dsonar.projectKey=InseeFr_Pogues-Back-Office -Dsonar.organization=inseefr -Dsonar.host.url=https://sonarcloud.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build with Maven Pogues-Back-Office
run: mvn clean package -DskipTests -B -V --file pom.xml
- name: Upload war
uses: actions/upload-artifact@v4
with:
name: jar
path: target/*.jar
docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download build
id: download
uses: actions/download-artifact@v4
with:
name: jar
path: target/
- name: Get current version
id: version
run: echo "prop=$(mvn -f pom.xml help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- run: echo ${{steps.version.outputs.prop}}
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: inseefr/pogues-back-office
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
tags: ${{steps.version.outputs.prop}}