- 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.
36 lines
1,015 B
YAML
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
|