Files
ai-media-hub/.gitea/workflows/build-push.yaml
AI Assistant 95c17b22ca
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 28s
Fix unauthorized error on Gitea registry by using github.token
2026-03-12 14:25:28 +09:00

45 lines
1.3 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
env:
REGISTRY: git.savethenurse.com
# CI/CD 파이프라인이 동작하는 Gitea 서버 자체의 레지스트리로 변경합니다.
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }} # Gitea 환경에서는 기본 제공되는 github.token을 사용해야 안전하게 인증됩니다.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- 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 }}
cache-from: type=gha
cache-to: type=gha,mode=max