Merge pull request #46 from Promix953/main

修复docker镜像构建
This commit is contained in:
johlanse 2022-08-06 09:59:53 +08:00 committed by GitHub
commit 356abe6bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -17,6 +17,11 @@ jobs:
- -
name: Checkout name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Fetch all tags
run: git fetch --force --tags
- -
name: Set up Go name: Set up Go
uses: actions/setup-go@v3 uses: actions/setup-go@v3
@ -40,13 +45,18 @@ jobs:
name: Set up Docker Buildx name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
-
name: Check snapshot
if: "!startsWith(github.ref, 'refs/tags/')"
id: snapshot
run: echo '::set-output name=ARG::--snapshot'
- -
name: Run GoReleaser name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3 uses: goreleaser/goreleaser-action@v3
with: with:
distribution: goreleaser distribution: goreleaser
version: latest version: latest
args: build --rm-dist args: build --rm-dist ${{ steps.snapshot.outputs.ARG }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- -
@ -73,4 +83,4 @@ jobs:
context: . context: .
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}