allow manual running #422
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 & Deploy | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
- 'LICENSE' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
paths-ignore: | |
- '**.md' | |
- '.gitignore' | |
- 'LICENSE' | |
jobs: | |
build: | |
name: Build, Analyze & Deploy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # for GitHub Pages deployment | |
pages: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required for SonarQube analysis | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
cache: 'maven' # Enables built-in Maven dependency caching | |
- name: Cache SonarQube packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-sonar- | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
mvn -B -Puber-jar verify \ | |
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ | |
-Dsonar.projectKey=micycle1_PTS \ | |
-Dsonar.java.source=17 \ | |
-Dmaven.test.failure.ignore=false | |
- name: Upload JAR artifact | |
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PGS-uber-jar | |
path: target/*.jar | |
if-no-files-found: error | |
retention-days: 90 | |
- name: Deploy Javadocs to GitHub Pages | |
if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: target/reports/apidocs |