This commit is contained in:
Havoc420Mac 2025-04-05 12:26:57 +08:00
parent 30f452b44d
commit 483296f906

View File

@ -53,31 +53,30 @@ jobs:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
# insecure: true # 允许 HTTP 连接 # Err: 无效
# - name: 提取 Docker 元数据
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# tags: |
# # main 分支使用标准标签
# type=raw,value=latest,enable=${{ steps.branch_name.outputs.branch == 'main' }}
# type=raw,value=${{ steps.branch_name.outputs.env_suffix }}
# type=sha,format=short,prefix=${{ steps.branch_name.outputs.env_suffix }}-
# type=ref,event=tag,prefix=${{ steps.branch_name.outputs.env_suffix }}-
- name: 提取 Docker 元数据
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# main 分支使用标准标签
type=raw,value=latest,enable=${{ steps.branch_name.outputs.branch == 'main' }}
type=raw,value=${{ steps.branch_name.outputs.env_suffix }}
type=sha,format=short,prefix=${{ steps.branch_name.outputs.env_suffix }}-
type=ref,event=tag,prefix=${{ steps.branch_name.outputs.env_suffix }}-
# - name: 构建并推送 Docker 镜像
# uses: docker/build-push-action@v5
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# build-args: |
# BUILDKIT_INLINE_CACHE=0
# # 添加清理缓存的命令
# outputs: type=docker,cleancache=true
- name: 构建并推送 Docker 镜像
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILDKIT_INLINE_CACHE=0
# 添加清理缓存的命令
outputs: type=docker,cleancache=true
# - name: Trigger Portainer Webhook
# run: |