Change document id to hex. Return 404 for missing status. More comments. #83
This file contains hidden or 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: Java Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - release-* | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Cache Maven packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2 | |
| - name: Checkout artifact repo (for release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: robcast/digilib-repo | |
| ref: gh-pages | |
| path: digilib-repo | |
| - name: Copy existing maven-repo (for release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| mkdir -p target/site/maven-repo | |
| cp -rp digilib-repo/maven-repo/* target/site/maven-repo/ | |
| - name: Build tests using Maven | |
| run: mvn -Pbuild-all -DskipTests=false test -B | |
| - name: Deploy javadoc and Maven artefacts (for release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: mvn -Pbuild-all javadoc:aggregate deploy -DaltDeploymentRepository=repo::default::file:target/site/maven-repo -B | |
| - name: Deploy javadoc and maven-repo to digilib-repo (for release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: crazy-max/ghaction-github-pages@v4 | |
| with: | |
| repo: robcast/digilib-repo | |
| target_branch: gh-pages | |
| build_dir: target/site | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.DIGILIB_REPO_TOKEN }} | |
| - name: Build documentation pages | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| run: mvn site site:site --projects=doc | |
| - name: Deploy html site to gh-pages | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| uses: crazy-max/ghaction-github-pages@v4 | |
| with: | |
| target_branch: gh-pages | |
| build_dir: doc/target/site | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: add WAR to GH Release (for release) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: webapp/target/digilib-webapp-*.war | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |