ci(docker): 更新 Docker 构建和发布工作流
-为不同的服务添加构建矩阵,支持 facade、auth 和 user 服务- 更新镜像名称,包含服务名称后缀 - 修改构建上下文,针对每个服务单独构建
This commit is contained in:
parent
e3aa2b22da
commit
40a270c9d6
7
.github/workflows/docker-publish.yml
vendored
7
.github/workflows/docker-publish.yml
vendored
@ -24,6 +24,9 @@ jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
service: [ "facade", "auth" ,"user" ]
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
@ -65,7 +68,7 @@ jobs:
|
||||
id: meta
|
||||
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.service }}
|
||||
|
||||
# Build and push Docker image with Buildx (don't push on PR)
|
||||
# https://github.com/docker/build-push-action
|
||||
@ -73,7 +76,7 @@ jobs:
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
|
||||
with:
|
||||
context: .
|
||||
context: app/${{ matrix.service }}/.
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user