diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 46e1ed40..53a223da 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,6 +47,28 @@ jobs: exit 1 if: github.event_name != 'workflow_dispatch' && steps.versioncheck.outputs.version != github.ref_name + - name: Set up JDK 11 for snapshots + uses: actions/setup-java@v3 + with: + java-version: "11" + distribution: "temurin" + cache: "maven" + server-id: openconext-snapshots + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + if: ( endsWith(steps.versioncheck.outputs.version, '-SNAPSHOT')) + + - name: Set up JDK 11 for releases + uses: actions/setup-java@v3 + with: + java-version: "11" + distribution: "temurin" + cache: "maven" + server-id: openconext-releases + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + if: ${{!( endsWith(steps.versioncheck.outputs.version, '-SNAPSHOT')) }} + - name: Deploy with Maven run: mvn --batch-mode deploy -DskipTests env: @@ -63,6 +85,18 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ghcr.io/openconext/openconext-oidcng/oidcng + flavor: | + latest=false + tags: | + type=ref,event=tag + type=semver,pattern={{version}},value=${{ steps.versioncheck.outputs.version }} + type=sha + - name: Build and push the oidcng-server uses: docker/build-push-action@v4 with: @@ -70,5 +104,5 @@ jobs: file: docker/Dockerfile platforms: linux/amd64 push: true - tags: | - ghcr.io/openconext/openconext-oidcng/oidcng-server:${{ steps.versioncheck.outputs.version }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}