Bump fsfe/reuse-action from 1 to 2 #86
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
# SPDX-FileCopyrightText: 2022 Alliander N.V. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Build Project | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- 'main' | |
- 'develop' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Cache Docker Register | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }} | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Create custom Maven Settings.xml | |
uses: whelk-io/maven-settings-xml-action@v21 | |
with: | |
output_file: custom_maven_settings.xml | |
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]' | |
- name: Build with Maven (Pull Request) | |
if: ${{ github.event_name == 'pull_request' }} | |
run: ./mvnw -s custom_maven_settings.xml -B -Pnative-image clean verify | |
- name: Build with Maven (Push) | |
if: ${{ github.event_name == 'push' }} | |
run: ./mvnw -s custom_maven_settings.xml -B clean verify |