Fix workflow to match cloud-api-emulator pattern

- Use gitea.actor instead of github.actor
- Use REGISTRY_TOKEN secret
- Use direct docker build/push commands
- Hardcode image name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
HWANG BYUNGHA
2026-02-02 23:49:22 +09:00
parent ef17e883be
commit 2907466706

View File

@@ -1,46 +1,27 @@
name: Build Container Image
name: Build and Push Container
on:
push:
branches: [main]
workflow_dispatch:
branches:
- main
env:
REGISTRY: gitea.anvil.it.com
IMAGE_NAME: ${{ github.repository }}
IMAGE: kaffa/vultr-api
jobs:
build:
build-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Registry
run: docker login ${{ env.REGISTRY }} -u ${{ gitea.actor }} -p ${{ secrets.REGISTRY_TOKEN }}
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push image for amd64
uses: docker/build-push-action@v5
with:
context: .
file: ./server/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and Push AMD64
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:amd64 -f server/Dockerfile .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:amd64
docker tag ${{ env.REGISTRY }}/${{ env.IMAGE }}:amd64 ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest