MSP-5494 add github actions ci to build & publish docker image

This commit is contained in:
Kirill Ryabov committed 2025-05-27 14:09:52 +03:00
1 parent d02a58345e
commit c371b68ba7
1 file changed
+6 -4
+6 -4
View File
@@ -1,7 +1,9 @@
name: Create and publish a Docker image
on:
push
push:
tags:
- 'v*'
env:
REGISTRY: ghcr.io
@@ -19,10 +21,10 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Read version from file
- name: Get version from tag
id: version_reader
run: |
VERSION=$(cat .version)
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
@@ -43,7 +45,7 @@ jobs:
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version_reader.outputs.version }}
${{ github.ref == 'refs/heads/main' && format('{0}/{1}:latest', env.REGISTRY, env.IMAGE_NAME) || ''}}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: |
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.version=${{ steps.version_reader.outputs.version }}