Files
ghbot/.gitea/workflows/build-push.yml
20ichrish 4366f4d818
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 2m16s
Remove GitHub-specific cache options from CI workflow
GHA cache doesn't work with Gitea Actions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 17:01:34 -08:00

48 lines
1.3 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
workflow_dispatch: # Manual trigger
env:
REGISTRY: ${{ vars.REGISTRY_HOST }} # Set in Gitea repo settings, e.g., gitea.local
IMAGE_NAME: ${{ gitea.repository }} # e.g., username/ghbot
jobs:
build-and-push:
runs-on: ubuntu-latest # Or your self-hosted runner label
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,prefix=
type=ref,event=branch
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false