优化action对大写用户名的处理

This commit is contained in:
NewName
2025-04-07 13:56:18 +08:00
parent fee18c727a
commit e3515145e0

View File

@@ -38,14 +38,20 @@ jobs:
- name: Set version from input
run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Convert repository name to lowercase
run: |
# 将 github.repository 整体转换为小写
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "REPO_LOWER=$REPO_LOWER" >> $GITHUB_ENV
- name: Build and push Docker image
run: |
cd ghproxy
docker buildx build --push \
--platform linux/amd64,linux/arm64 \
--tag ghcr.io/${{ github.repository }}:${{ env.VERSION }} \
--tag ghcr.io/${{ github.repository }}:latest \
--tag ghcr.io/${{ env.REPO_LOWER }}:${{ env.VERSION }} \
--tag ghcr.io/${{ env.REPO_LOWER }}:latest \
--build-arg VERSION=${{ env.VERSION }} \
-f Dockerfile .
env:
GHCR_PUBLIC: true # 将镜像设置为公开
GHCR_PUBLIC: true # 将镜像设置为公开