add workflow to build site and deploy to netlify #1
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: Generate Site | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Graphviz | |
uses: ts-graphviz/[email protected] | |
- uses: actions/[email protected] | |
- uses: actions/[email protected] | |
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/[email protected] | |
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 }} | |