correct after CR #957
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build snapshot docker image | ||
| on: | ||
| push: | ||
| branches-ignore: | ||
| - * # main | ||
| # turned off for now (needs secrets renewal) | ||
| jobs: | ||
| build-snapshot: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| branch: ${{ steps.extract_branch.outputs.branch }} | ||
| steps: | ||
| - name: Extract branch name | ||
| shell: bash | ||
| run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT | ||
| id: extract_branch | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ steps.extract_branch.outputs.branch }} | ||
| - name: Set up JDK 25 | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: "temurin" | ||
| java-version: "25" | ||
| - name: install model filiere | ||
| run: mvn install:install-file -Dfile="$(pwd)/libs/modelefiliere-2.1.0.jar" -DgroupId=fr.insee -DartifactId=modelefiliere -Dversion=2.1.0 -Dpackaging=jar -DgeneratePom=true | ||
| - name: Clone BPM | ||
| uses: actions/checkout@master | ||
| with: | ||
| repository: InseeFr/BPM | ||
| path: bpm | ||
| - name: Build BPM | ||
| run: | | ||
| cd bpm | ||
| mvn clean install --no-transfer-progress | ||
| cd .. | ||
| - name: Build API | ||
| run: mvn package --no-transfer-progress | ||
| - name: Upload API jar | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: app-jar | ||
| path: target/*.jar | ||
| docker: | ||
| needs: | ||
| - build-snapshot | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Download uploaded jar | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| name: app-jar | ||
| path: target/ | ||
| - name: Create docker version tag | ||
| id: docker-version | ||
| run: | | ||
| # replace '/' by '-' for docker tags | ||
| docker_tag="${{ needs.build-snapshot.outputs.branch }}" | ||
| docker_tag=$(echo "$docker_tag" | sed 's/[\/+]/-/g') | ||
| echo "docker_tag=${docker_tag}" >> $GITHUB_ENV | ||
| - name: Publish to Docker Hub | ||
| uses: elgohr/Publish-Docker-Github-Action@v5 | ||
| with: | ||
| name: inseefr/genesis-api | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| default_branch: ${{ github.ref }} | ||
| tags: "snapshot-${{ env.docker_tag }}" | ||
| workdir: . | ||