@@ -12,6 +12,9 @@ concurrency:
1212 group : ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1313 cancel-in-progress : true
1414
15+ env :
16+ DEFAULT_PYTHON : ' 3.13'
17+
1518jobs :
1619 release :
1720 name : Build & push scheduler image to Dockerhub
@@ -34,14 +37,31 @@ jobs:
3437 - name : Checkout code
3538 uses : actions/checkout@v4
3639
37- - name : Set tag
38- id : set_tag
40+ - name : Set up Python ${{ env.DEFAULT_PYTHON }}
41+ uses : actions/setup-python@v5
42+ with :
43+ python-version : ${{ env.DEFAULT_PYTHON }}
44+
45+ - name : Install poetry
46+ uses : snok/install-poetry@v1
47+
48+ - name : Get version
49+ id : get_version
3950 run : |
40- if [[ "${{ github.ref_type }}" == "branch" && "${{ github.ref_name }}" == "develop" ]]; then
41- echo "TAG=mtsrus/syncmaster-scheduler:develop" >> $GITHUB_ENV
42- elif [[ "${{ github.ref_type }}" == "tag" ]]; then
43- echo "TAG=mtsrus/syncmaster-scheduler:latest,mtsrus/syncmaster-scheduler:${{ github.ref_name }}" >> $GITHUB_ENV
44- fi
51+ echo "VERSION=$(poetry version --short)" >> $GITHUB_ENV
52+
53+ - name : Docker meta
54+ id : meta
55+ uses : docker/metadata-action@v5
56+ with :
57+ images : mtsrus/syncmaster-scheduler
58+ labels : |
59+ org.opencontainers.image.title=SyncMaster Scheduler
60+ org.opencontainers.image.vendor=MTS PJSC
61+ org.opencontainers.image.documentation=https://syncmaster.readthedocs.io
62+ org.opencontainers.image.url=https://hub.docker.com/r/mtsrus/syncmaster-worker
63+ org.opencontainers.image.authors=DataOps.ETL <[email protected] > 64+ org.opencontainers.image.version=${{ env.VERSION }}
4565
4666 - name : Set platforms
4767 id : set_platforms
@@ -56,10 +76,11 @@ jobs:
5676 - name : Build scheduler image
5777 uses : docker/build-push-action@v6
5878 with :
59- tags : ${{ env.TAG }}
6079 context : .
6180 target : prod
6281 file : docker/Dockerfile.scheduler
82+ tags : ${{ steps.meta.outputs.tags }}
83+ labels : ${{ steps.meta.outputs.labels }}
6384 pull : true
6485 push : true
6586 cache-to : type=inline
85106 # this requires token with read+write+delete permissions. read+write is not enough!
86107 password : ${{ secrets.DOCKERHUB_TOKEN }}
87108 repository : mtsrus/syncmaster-scheduler
88- short-description : ${{ github.event.repository.description }}
109+ short-description : ${{ github.event.repository.description }} (Scheduler)
89110 enable-url-completion : true
0 commit comments