@@ -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
0 commit comments