Test buildah docker build.
Some checks failed
Build and Push Docker Image / build (push) Failing after 12s

This commit is contained in:
2026-02-18 19:57:06 +01:00
parent db8c7f8a19
commit 7c8495d8d4

View File

@@ -2,7 +2,7 @@ name: Build and Push Docker Image
on:
push:
branches: [ main ]
branches: [main]
jobs:
build:
@@ -18,25 +18,24 @@ jobs:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build Docker Image
- name: Buildah Build
env:
BRANCH_NAME: ${{ github.ref_name }}
SHORT_HASH: ${{ github.sha }}
run: |
# Build the image with the commit hash tag
docker build --build-arg BUILD_IDENTIFIER=${SHORT_HASH:0:5} -t git.kocoder.xyz/kocoded/vt-be:${BRANCH_NAME}-${SHORT_HASH:0:5} .
# Tag the same image as "latest"
docker tag git.kocoder.xyz/kocoded/vt-be:${BRANCH_NAME}-${SHORT_HASH:0:5} git.kocoder.xyz/kocoded/vt-be:${BRANCH_NAME}-latest
uses: redhat-actions/buildah-build@v2
with:
containerfiles: "Dockerfile"
iamge: git.kocoder.xyz/kocoded/vt-be
tags: ${{ github.ref_name }} latest
- name: Push Docker Images
env:
BRANCH_NAME: ${{ github.ref_name }}
SHORT_HASH: ${{ github.sha }}
run: |
docker push git.kocoder.xyz/kocoded/vt-be:${BRANCH_NAME}-${SHORT_HASH:0:5}
docker push git.kocoder.xyz/kocoded/vt-be:${BRANCH_NAME}-latest
docker push git.kocoder.xyz/kocoded/vt-be:${BRANCH_NAME}
docker push git.kocoder.xyz/kocoded/vt-be:latest
- name: Log out from registry
if: always()
run: docker logout git.kocoder.xyz
run: docker logout git.kocoder.xyz