-
Notifications
You must be signed in to change notification settings - Fork 234
94 lines (84 loc) · 2.99 KB
/
publish-docker.yml
File metadata and controls
94 lines (84 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# Copyright (c) 2026 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: "Publish Docker Images"
on:
push:
branches:
- main
tags:
- "*"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push:
name: "Build docker image for ${{ matrix.name }}"
runs-on: ubuntu-latest
if: github.repository_owner == 'eclipse-edc'
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@v4
- name: Log in to GHCR
uses: docker/login-action@v4
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 '^version=' 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@v7
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