Workflow enhancement: deploy Arc42 as GH-Page #38
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 (master) | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
tags-ignore: | |
- '**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Install Graphviz | |
run: sudo apt-get -y install graphviz | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- uses: actions/cache@v2 | |
id: target-cache | |
with: | |
path: ./target/* | |
key: ${{ github.sha }} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
upload_arc42_pdf: | |
name: Upload Architecture Documentation (PDF) | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
steps: | |
- uses: actions/cache@v2 | |
id: target-cache | |
with: | |
path: ./target/* | |
key: ${{ github.sha }} | |
- name: Upload Architecture Documentation | |
uses: actions/upload-artifact@v3 | |
with: | |
name: arc42-doc | |
path: | | |
target/generated-docs/ddd-cm-sample-architecture.pdf | |
publish_gh_page: | |
name: Publish GH Page | |
runs-on: ubuntu-latest | |
needs: [ build ] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/cache@v2 | |
id: target-cache | |
with: | |
path: ./target/* | |
key: ${{ github.sha }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: './target/generated-docs' | |
if-no-files-found: error | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |