forked from eclipse-edc/DataDashboard
-
Notifications
You must be signed in to change notification settings - Fork 15
73 lines (63 loc) · 2.21 KB
/
build-and-release-image.yaml
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
name: Build and Release Image
on:
workflow_dispatch:
inputs:
imageName:
description: 'Name of the image, that will be available as package'
required: true
type: string
push:
branches:
- main
tags:
- "*"
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: edc-ui
IMAGE_NAME_BASE: ${{ github.repository_owner }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Checkout code
- uses: actions/checkout@v3
- name: Log in to the Container registry (push-only)
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Store last commit's author, message and SHA
run: |
echo "Saving local commit details in src/assets/config/version.txt"
git log -1 > src/assets/config/version.txt
echo "Saving build date to src/assets/config/ui-build-date.txt"
date --utc +%FT%TZ > src/assets/config/ui-build-date.txt
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_BASE }}/${{ env.IMAGE_NAME }}
labels: |
org.opencontainers.image.title=EDC-UI extended by sovity
org.opencontainers.image.description=EDC-UI for sovity's extended EDC-Connector.
tags: |
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/') }}
type=raw,value=latest,enable={{is_default_branch}}
type=sha,enable={{is_default_branch}}
type=raw,value=${{ inputs.imageName }},enabled=${{ github.event_name == 'workflow_dispatch' }}
- name: Build EDC-UI image
uses: docker/build-push-action@v4
with:
file: docker/Dockerfile
context: .
build-args: |
EDC_UI_CONFIGURATION=production
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}