Skip to content

Manual Deploy and site publishing #8

Manual Deploy and site publishing

Manual Deploy and site publishing #8

Workflow file for this run

name: Manual Deploy and site publishing
on:
workflow_dispatch:
inputs:
java-version:
description: 'Java version'
required: true
type: choice
options:
- '21'
- '8'
- '11'
- '17'
default: '21'
do-build:
description: 'Build the project'
required: true
type: boolean
default: true
do-site:
description: 'Publish the site'
required: true
type: boolean
default: true
jobs:
deploy:
runs-on: ubuntu-24.04
permissions:
contents: write
pages: write
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ inputs.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
cache: maven
server-id: github
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ inputs.java-version }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ inputs.java-version }}
- name: Deploy with Maven
if: inputs.do-build
run: mvn -B deploy -DskipTests -P github
- name: Maven Site
if: inputs.do-site
run: |
git config --global user.name "Github Actions"
git config --global user.email "[email protected]"
mvn -B site site:stage scm-publish:publish-scm -P github -X