Skip to content

add workflow to build site and deploy to netlify #2

add workflow to build site and deploy to netlify

add workflow to build site and deploy to netlify #2

name: Generate Site
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
java-version: '17'
distribution: 'temurin'
- name: Set prod env var
id: set-prod
run: echo "prod=$([[ $GITHUB_REF == refs/heads/main ]] && echo true || echo false)" >> $GITHUB_ENV
- name: Generate Site
run: mvn generate-resources
- uses: jsmrcaga/action-netlify-deploy@06b6a09e152823cce0d76c0dbb22b914934de198 # v2.3.0
with:
build_directory: ./target/generated-docs/
install_command: "echo Skipping installing the dependencies"
build_command: "echo Skipping building the web files"
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DEPLOY_TO_PROD: ${{ env.prod }}