tercul-backend/.gitea/workflows/docker-build.yml
Damir Mukimov ad749d9184
Some checks failed
Test / Unit Tests (push) Failing after 1m20s
Build / Build Binary (push) Failing after 2m32s
Docker Build / Build Docker Image (push) Failing after 2m37s
Test / Integration Tests (push) Successful in 4s
Lint / Go Lint (push) Failing after 18m28s
Add Gitea Actions workflows for CI/CD
2025-12-24 23:27:45 +01:00

56 lines
1.4 KiB
YAML

name: Docker Build
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
build-image:
name: Build Docker Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: gitea.bk.glpx.pro
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Extract metadata
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: gitea.bk.glpx.pro/mukimovd/tercul-backend
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=long
- name: Build and push
id: push
uses: https://github.com/docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: ${{ gitea.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max