diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3f0e35d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,54 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + + - name: Build with Maven + run: | + if [[ "$GITHUB_REF" =~ ^refs/tags/ ]]; then \ + PHASES="install site" \ + elif [[ "$GITHUB_EVENT_NAME" = "pull_request" ]]; then \ + PHASES="verify" \ + else \ + PHASES="deploy" \ + fi && \ + mvn -B -s config/settings.ci.xml $PHASES -PrunITs + + - uses: actions/upload-pages-artifact@v1 + if: ${{ startsWith(github.ref, 'refs/tags/' }} + with: + path: client/target/generated-docs + + deploy-pages: + if: ${{ startsWith(github.ref, 'refs/tags/' }} + + needs: build + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2