wolf-bubenik triggered module build #60
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 | |
run-name: ${{ github.actor }} triggered module build | |
on: | |
workflow_dispatch: # allow to run from Github web UI | |
push: # see https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#using-a-single-event | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
- name: Cache Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Create settings.xml | |
run: | | |
mkdir -p ~/.m2 | |
echo "<settings><servers><server><id>magnolia.enterprise</id><username>${{secrets.MGNL_USERNAME}}</username><password>${{secrets.MGNL_PASSWORD}}</password></server><server><id>magnolia.forge.snapshots</id><username>${{secrets.MGNL_USERNAME}}</username><password>${{secrets.MGNL_PASSWORD}}</password></server></servers></settings>" > ~/.m2/settings.xml | |
- name: Build PR or branch with Maven | |
if: ${{ github.base_ref != 'main' }} | |
run: mvn -B clean verify -DtomcatTest | |
- name: Build and Deploy main branch with Maven | |
if: ${{ github.base_ref == 'main' }} | |
run: mvn -B clean deploy |