Files
watcher-visio/.gitea/workflows/docker-build.yml
Nikolay Tatarinov 84cd602cea
All checks were successful
CI / ci (push) Successful in 14s
CI / ci (pull_request) Successful in 14s
Update Docker build workflow to enforce lowercase repository names
- Modified the Docker build process in docker-build.yml to convert the repository name to lowercase, ensuring consistent image naming conventions.
- This change helps prevent potential issues with case sensitivity in image tags when pushing to the registry.
2026-02-07 18:08:44 +03:00

77 lines
2.3 KiB
YAML

name: Docker build and release
on:
push:
branches: [main]
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
tag: ${{ steps.meta.outputs.tag }}
steps:
- name: Checkout
uses: https://gitea.com/actions/checkout@v4
with:
fetch-depth: 0
- name: Set release tag
id: meta
run: |
echo "tag=v$(date +%Y%m%d)-${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
- name: Extract registry host
id: registry
run: |
echo "host=${GITHUB_SERVER_URL#https://}" >> $GITHUB_OUTPUT
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ steps.registry.outputs.host }} -u ${{ github.actor }} --password-stdin
- name: Build and push
run: |
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
IMAGE="${{ steps.registry.outputs.host }}/$REPO_LOWER"
TAG="${{ steps.meta.outputs.tag }}"
docker build -t "$IMAGE:$TAG" -t "$IMAGE:latest" .
docker push "$IMAGE:$TAG"
docker push "$IMAGE:latest"
release:
runs-on: ubuntu-latest
needs: build-and-push
permissions:
contents: write
steps:
- name: Checkout
uses: https://gitea.com/actions/checkout@v4
with:
fetch-depth: 0
- name: Generate release notes
id: notes
run: |
PREV=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -z "$PREV" ]; then
echo "## Changes" > release_notes.md
echo "" >> release_notes.md
git log --pretty=format:"- %s (%h)" >> release_notes.md || echo "- Initial release" >> release_notes.md
else
echo "## Changes since $PREV" > release_notes.md
echo "" >> release_notes.md
git log "$PREV"..HEAD --pretty=format:"- %s (%h)" >> release_notes.md
fi
- name: Create release
uses: https://gitea.com/actions/gitea-release-action@v1
with:
token: ${{ secrets.REGISTRY_TOKEN }}
tag_name: ${{ needs.build-and-push.outputs.tag }}
body_path: release_notes.md
target_commitish: ${{ github.sha }}