2025-05-27 15:03:30: merge [master:f7d84c21ab1049a1f10eacacc773ddeead8d619b];
Create and publish a Docker image / build-and-push-image (push) Canceled after 0s

This commit is contained in:
txix committed 2025-05-27 15:03:30 +03:00
1 parent 65cfb65f8e
commit ec0f1a02d1
2 files changed
+25 -19

No files matched your search

+7 -5
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 }}
@@ -55,4 +57,4 @@ jobs:
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
push-to-registry: true