Issue templates #20
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 and push | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [ '21' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Login to GitLab | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
cache: 'maven' | |
- name: Spotless | |
run: mvn spotless:check | |
- name: Build with Maven | |
run: mvn clean verify spring-boot:build-image | |
- name: Build and push | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) | |
echo ${VERSION} | |
docker push ehrbase/migration-tool:${VERSION} | |