fix docker workflow
Some checks failed
Build and Push Docker Image / build (push) Failing after 12m58s

This commit is contained in:
kaffa
2026-03-24 09:12:50 +00:00
parent 9f1f728784
commit c6fa024bb2

View File

@@ -1 +1,32 @@
name: Build and Push Docker Image
on:
push:
branches:
- master
- main
env:
REGISTRY: gitea.anvil.it.com
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
run: |
SHORT_SHA=$(echo "${{ gitea.sha }}" | cut -c1-7)
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA} .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${SHORT_SHA}