Potentially build Opencast during build #249
Workflow file for this run
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: Deploy Maven artifacts | |
| on: push | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: m2 deployment | |
| steps: | |
| - name: Check out the code | |
| uses: actions/checkout@v4 | |
| - name: Set up a compatible Java version | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| cache: maven | |
| - name: See if we have the Opencast artifacts | |
| id: exists | |
| run: | | |
| if [ -d ~/.m2/repository/org/opencastproject/base/17.0 ] | |
| then | |
| echo exists=true >> "$GITHUB_OUTPUT" | |
| else | |
| echo exists=false >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Potentially check out Opencast | |
| if: steps.exists.outputs.exists == 'false' | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: opencast/opencast | |
| ref: 17.0 | |
| path: opencast | |
| - name: Potentially build Opencast | |
| if: steps.exists.outputs.exists == 'false' | |
| run: | | |
| cd opencast | |
| mvn clean install -Pnone -T1C \ | |
| -Dmaven.test.skip \ | |
| -DskipTests \ | |
| -Dcheckstyle.skip \ | |
| -Dmdep.analyze.skip | |
| - name: Potentially restore node from cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| frontend/node | |
| key: node-${{ hashFiles('frontend/pom.xml') }} | |
| restore-keys: node- | |
| - name: Potentially restore npm dependencies from cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.npm | |
| key: npm-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: npm- | |
| - name: Check out the m2 repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: m2 | |
| path: m2 | |
| - name: Generate revision | |
| id: revision | |
| run: echo "revision=$(date +%Y.%m%d.%H%M%S)-${{ github.sha }}" >> $GITHUB_OUTPUT | |
| - name: Build the artifacts | |
| run: mvn clean deploy | |
| --batch-mode | |
| -DmaxWarnings=0 | |
| -DaltDeploymentRepository=m2::file:m2 | |
| -Drevision=${{ steps.revision.outputs.revision }} | |
| - name: Deploy the artifacts to GitHub | |
| uses: EndBug/add-and-commit@v9 | |
| with: | |
| message: ${{ steps.revision.outputs.revision }} | |
| cwd: m2 |