name: build and publish docker image / deploy
on:
push:
branches: ["dev"]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Restore cached Primes
id: maven-cache-restore
uses: https://github.com/actions/cache/restore@v4
with:
path: |
path/to/dependencies
some/other/dependencies
key: ${{ runner.os }}-maven
- uses: https://github.com/actions/checkout@v4
repository: 'learningpulse/server'
ref: 'dev'
token: '${{ secrets.token }}'
- name: 'Set up java 22'
uses: https://github.com/actions/setup-java@v4
java-version: "22"
distribution: "temurin"
- name: Setup maven
if: steps.maven-cache.outputs.cache-hit != 'true'
uses: https://github.com/stCarolas/setup-maven@v5
maven-version: 3.9.6
- name: Cache local Maven repository
uses: https://github.com/actions/cache/save@v4
id: maven-cache-save
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven
- name: Build with Maven
run: mvn -Dtoken=${{ secrets.token }} clean compile jib:build -e