Files
Zed fb998535f8
Build and Publish Docker Image / build-and-push-image (push) Successful in 1m18s
Convert image name to lowercase to fix Docker invalid tag error
2026-07-06 19:24:42 +02:00

35 lines
1002 B
YAML

name: Build and Publish Docker Image
on:
push:
branches:
- master
env:
REGISTRY: 192.168.10.174:3000
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Simple login directly with docker login
- name: Log in to the Container registry
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login ${{ env.REGISTRY }} -u "${{ gitea.actor }}" --password-stdin
# Build standard using docker CLI
- name: Build Docker image
run: |
LOWERCASE_IMAGE=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
docker build -t ${{ env.REGISTRY }}/$LOWERCASE_IMAGE:latest .
# Push directly using docker push
- name: Push Docker image
run: |
LOWERCASE_IMAGE=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
docker push ${{ env.REGISTRY }}/$LOWERCASE_IMAGE:latest