feat: 简化 Docker 构建推送工作流,移除操作系统矩阵并强制使用 Ubuntu

This commit is contained in:
严浩
2024-10-12 17:51:57 +08:00
parent 76e102f6a5
commit 6cf720250a

View File

@ -12,11 +12,11 @@ env:
jobs:
job:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # https://docs.github.com/zh/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#用于公共存储库的-github-托管的标准运行器
runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-latest] # https://docs.github.com/zh/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#用于公共存储库的-github-托管的标准运行器
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: yanhao98/semantic-release-action@main
@ -37,12 +37,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- uses: yanhao98/composite-actions/docker-build-push@main
# if: steps.semantic.outputs.next_release_published == 'true'
if: steps.semantic.outputs.next_release_published == 'true'
id: docker-build-push
with:
build_file: ./Dockerfile.test
build_platforms: linux/amd64,linux/arm64
build_push: ${{ matrix.os == 'ubuntu-latest' && steps.semantic.outputs.next_release_published == 'true' }}
build_push: true
build_load: false
metadata_images: |
docker.io/${{ vars.DOCKERHUB_USERNAME }}/docker-example