upgrade to scout 24.1 #22
Workflow file for this run
This file contains 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, package and deploy java parts | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
DOCKER_REGISTRY: ghcr.io | |
DOCKER_IMAGE_NAME: ${{ github.repository }} | |
DOCKER_TAG_SHA: ${{ github.sha }} | |
DOCKER_TAG_REF: ${{ github.ref_name }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
java-version: [ 17 ] | |
steps: | |
- uses: actions/checkout@v3 | |
# Login against a Docker registry except on PR | |
# https://github.com/docker/login-action | |
- name: Log into registry ${{ env.DOCKER_REGISTRY }} | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'temurin' | |
cache: maven | |
- name: Build zip with Maven and run tests | |
run: | | |
mvn verify \ | |
-B --fail-at-end --no-transfer-progress --file pom.xml | |
- name: Publish Unit Test Report | |
if: success() || failure() | |
uses: scacap/action-surefire-report@v1 | |
- name: Build and push image except on PR | |
if: github.event_name != 'pull_request' | |
run: | | |
mvn install \ | |
-P exec.docker.image \ | |
-D docker.app.image.registry=${{ env.DOCKER_REGISTRY }} \ | |
-D docker.app.image.name=${{ env.DOCKER_IMAGE_NAME }} \ | |
-D docker.app.image.tag=${{ env.DOCKER_TAG_REF }} \ | |
-D docker.app.image.tag2=${{ env.DOCKER_TAG_SHA }} \ | |
-am -pl addondemo.app.image |