Files
sale/.gitea/workflows/docker.yml
T
admin 04420c4ad9
Build and Push Docker Image / build-and-push (push) Successful in 3m50s
Docker Build / Build and Push Docker Image (push) Has been cancelled
Docker Build / Deploy to Server (push) Has been cancelled
ci: 密钥名称改为 TOKEN
2026-06-27 04:20:32 +08:00

48 lines
1.2 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches: [main]
workflow_dispatch:
env:
REGISTRY: git.viaeon.com
IMAGE_NAME: git.viaeon.com/admin/sale
jobs:
build-and-push:
runs-on: ubuntu
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: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=sha,prefix=
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
file: ./backend/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
no-cache: true