Skip to content

Commit 27ea79e

Browse files
committed
[DOP-25355] Populate docker image meta
1 parent 977d843 commit 27ea79e

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,43 @@ jobs:
3131
username: ${{ secrets.DOCKERHUB_USERNAME }}
3232
password: ${{ secrets.DOCKERHUB_TOKEN }}
3333

34+
- name: Install Node.JS
35+
uses: actions/setup-node@v4
36+
3437
- name: Checkout code
3538
uses: actions/checkout@v4
3639

37-
- name: Set tag
38-
id: set_tag
40+
- name: Get version
41+
id: get_version
3942
run: |
40-
if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "develop" ]]; then
41-
echo "TAG=mtsrus/syncmaster-ui:develop" >> $GITHUB_ENV
42-
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
43-
echo "TAG=mtsrus/syncmaster-ui:latest,mtsrus/syncmaster-ui:${{ github.ref_name }}" >> $GITHUB_ENV
44-
fi
43+
version=$(node -p "require('./package.json').version")
44+
echo "VERSION=${version}" >> $GITHUB_ENV
45+
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: mtsrus/syncmaster-ui
51+
labels: |
52+
org.opencontainers.image.title=SyncMaster UI
53+
org.opencontainers.image.vendor=MTS PJSC
54+
org.opencontainers.image.documentation=https://syncmaster.readthedocs.io
55+
org.opencontainers.image.url=https://hub.docker.com/r/mtsrus/syncmaster-ui
56+
org.opencontainers.image.authors=DataOps.ETL <[email protected]>
57+
org.opencontainers.image.version=${{ env.VERSION }}
4558
4659
- name: Build UI image
4760
uses: docker/build-push-action@v6
4861
with:
49-
tags: ${{ env.TAG }}
5062
context: .
51-
file: ./docker/Dockerfile
5263
target: prod
64+
file: ./docker/Dockerfile
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
5367
pull: true
5468
push: true
55-
cache-to: type=inline
56-
cache-from: mtsrus/syncmaster-ui:develop
69+
cache-to: type=gha,mode=max
70+
cache-from: type=gha
5771
platforms: |
5872
linux/amd64
5973
linux/arm64/v8

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "syncmaster_ui",
3-
"version": "1.0.0",
3+
"version": "0.2.0",
44
"private": true,
5-
"description": "Initial settings for react app",
6-
"license": "UNLICENSED",
5+
"description": "Frontend for SyncMaster",
6+
"license": "Apache-2.0",
77
"scripts": {
88
"start": "cross-env NODE_ENV=development webpack serve",
99
"start:prod": "cross-env NODE_ENV=production webpack serve",

0 commit comments

Comments
 (0)