Build and Push Launcher Images #79
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
| # | |
| # Copyright (c) 2025 Metaform Systems, Inc. | |
| # | |
| # This program and the accompanying materials are made available under the | |
| # terms of the Apache License, Version 2.0 which is available at | |
| # https://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| # | |
| # Contributors: | |
| # Metaform Systems, Inc. - initial API and implementation | |
| # | |
| name: Build and Push Launcher Images | |
| on: | |
| workflow_dispatch: | |
| workflow_run: | |
| workflows: [ "Verify" ] | |
| types: | |
| - completed | |
| branches: [ main ] | |
| jobs: | |
| build-and-push-postgres: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set lowercase repository name | |
| id: repo | |
| run: | | |
| repo_lowercase=$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]') | |
| echo "repo_lowercase=${repo_lowercase}" >> "$GITHUB_OUTPUT" | |
| - name: Build and push custom Postgres image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: launchers/postgres | |
| file: launchers/postgres/Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ steps.repo.outputs.repo_lowercase }}/postgres:wal2json | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| platforms: linux/amd64,linux/arm64 | |
| build-and-push-runtimes: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - name: controlplane | |
| context: launchers/controlplane | |
| dockerfile: launchers/controlplane/src/main/docker/Dockerfile | |
| - name: issuerservice | |
| context: launchers/issuerservice | |
| dockerfile: launchers/issuerservice/src/main/docker/Dockerfile | |
| - name: identity-hub | |
| context: launchers/identity-hub | |
| dockerfile: launchers/identity-hub/src/main/docker/Dockerfile | |
| - name: dataplane | |
| context: launchers/dataplane | |
| dockerfile: launchers/dataplane/src/main/docker/Dockerfile | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set lowercase repository name | |
| id: repo | |
| run: | | |
| repo_lowercase=$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]') | |
| echo "repo_lowercase=${repo_lowercase}" >> "$GITHUB_OUTPUT" | |
| - name: Extract version from gradle.properties | |
| id: version | |
| run: | | |
| version=$(grep '^jadVersion=' gradle.properties | cut -d'=' -f2) | |
| echo "version=${version}" >> "$GITHUB_OUTPUT" | |
| - uses: eclipse-edc/.github/.github/actions/setup-build@main | |
| - name: Build JAR file | |
| run: | | |
| ./gradlew -p ${{ matrix.context }} shadowJar | |
| - name: Build and push image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| build-args: | |
| JAR=build/libs/${{ matrix.name }}.jar | |
| context: ${{ matrix.context }} | |
| file: ${{ matrix.dockerfile }} | |
| push: true | |
| tags: | | |
| ghcr.io/${{ steps.repo.outputs.repo_lowercase }}/${{ matrix.name }}:latest | |
| ghcr.io/${{ steps.repo.outputs.repo_lowercase }}/${{ matrix.name }}:${{ github.sha }} | |
| ghcr.io/${{ steps.repo.outputs.repo_lowercase }}/${{ matrix.name }}:${{ steps.version.outputs.version }} | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/${{ github.repository }} | |
| platforms: linux/amd64,linux/arm64 |