Files
EIS-dotnet/.gitea/workflows/docker-publish.yml
T
biss e3c04dad8a 本轮迁移已完成,生产运行链路现已切换为纯 ASP.NET Core 10。
主要完成:
补齐招生学校计划、投档审核、报到、扫码、补录等原生接口。
新增 SQLite/MySQL 空库初始化及默认审批流、号码规则。
删除 Node 兼容代理,未知 API 直接返回原生 404。
Docker、Compose、Gitea CI 全部切换到 Eis.Web.dll。
CKEditor 已固化到 Web 发布资源,不再依赖 node_modules。
新增纯 .NET 冒烟脚本:[smoke-dotnet-native.ps1 (line 1)](C:/Users/BI/Documents/EIS-dotnet/scripts/smoke-dotnet-native.ps1:1)。
迁移状态已更新:[MIGRATION.md (line 14)](C:/Users/BI/Documents/EIS-dotnet/MIGRATION.md:14)。
容器入口见 [Dockerfile (line 31)](C:/Users/BI/Documents/EIS-dotnet/Dockerfile:31)。
2026-07-23 15:14:42 +08:00

101 lines
3.2 KiB
YAML

name: Build and publish Docker images
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
publish:
name: Test, build and publish
runs-on: ubuntu-latest
permissions:
contents: read
releases: write
steps:
- name: Check out repository
uses: https://github.com/actions/checkout@v4
- name: Set up .NET
uses: https://github.com/actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- name: Run tests
run: dotnet test Eis.slnx --configuration Release
- name: Set up QEMU
uses: https://github.com/docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: https://github.com/docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to Gitea Container Registry
uses: https://github.com/docker/login-action@v3
with:
registry: git.biss.click
username: ${{ vars.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Generate image tags and labels
id: metadata
uses: https://github.com/docker/metadata-action@v5
with:
images: |
docker.io/${{ vars.DOCKERHUB_IMAGE }}
git.biss.click/biss/exam-information-system
flavor: latest=false
tags: |
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/master' }}
type=sha,format=short,prefix=sha-
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push image
uses: https://github.com/docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
cache-from: type=registry,ref=docker.io/${{ vars.DOCKERHUB_IMAGE }}:buildcache
cache-to: type=registry,ref=docker.io/${{ vars.DOCKERHUB_IMAGE }}:buildcache,mode=max
- name: Detect release type
id: release_type
if: gitea.ref_type == 'tag'
shell: bash
run: |
case "$GITHUB_REF_NAME" in
*-*) prerelease=true ;;
*) prerelease=false ;;
esac
echo "prerelease=$prerelease" >> "$GITHUB_OUTPUT"
- name: Create Gitea release
if: gitea.ref_type == 'tag'
uses: https://gitea.com/actions/gitea-release-action@v1
with:
token: ${{ secrets.GITEA_TOKEN }}
tag_name: ${{ gitea.ref_name }}
name: ${{ gitea.ref_name }}
prerelease: ${{ steps.release_type.outputs.prerelease }}
body: |
Docker 镜像已发布:
```text
docker pull docker.io/${{ vars.DOCKERHUB_IMAGE }}:${{ steps.metadata.outputs.version }}
docker pull git.biss.click/biss/exam-information-system:${{ steps.metadata.outputs.version }}
```