lcc_tool/.gitea/workflows/build.yml
Jan 66a77babfe Update .dockerignore and improve Gitea CI workflow
- Expanded `.dockerignore` to include additional build artifacts, OS files, test files, IDE files, logs, and docs.
- Enhanced Gitea CI workflow by integrating `docker/setup-buildx-action` and switching to `docker/build-push-action` with caching support.
2025-10-23 19:13:43 +02:00

36 lines
1,015 B
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.avatic.de -u "${{ gitea.actor }}" --password-stdin
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
git.avatic.de/${{ gitea.repository_owner }}/lcc:${{ gitea.sha }}
git.avatic.de/${{ gitea.repository_owner }}/lcc:latest
cache-from: type=registry,ref=git.avatic.de/${{ gitea.repository_owner }}/lcc:buildcache
cache-to: type=registry,ref=git.avatic.de/${{ gitea.repository_owner }}/lcc:buildcache,mode=max