diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5a6d8a3d..f1698336 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -6,6 +6,8 @@ name: Docker # documentation. on: + push: + branches: [ master ] release: types: [ released ] @@ -23,7 +25,7 @@ jobs: ref: ${{ github.event.workflow_run.head_sha }} fetch-depth: 0 submodules: 'recursive' - + - uses: dotnet/nbgv@master with: setAllVars: true @@ -64,6 +66,19 @@ jobs: flavor: | latest=true + - name: Extract Docker full metadata + id: metafull + uses: docker/metadata-action@v4 + with: + images: | + farmer1992/sshpiperd + ghcr.io/${{ github.repository }} + tags: | + type=raw,value=v${{ env.NBGV_SimpleVersion }} + flavor: | + latest=auto + prefix=full- + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image @@ -72,6 +87,22 @@ jobs: context: . platforms: linux/amd64,linux/arm64,linux/arm/v7 build-args: VER=${{ env.NBGV_SimpleVersion }} - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name == 'release' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Build and push full Docker image + uses: docker/build-push-action@v3 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/arm/v7 + build-args: | + - VER=${{ env.NBGV_SimpleVersion }} + - BUILDTAGS=full + push: ${{ github.event_name == 'release' }} + tags: ${{ steps.metafull.outputs.tags }} + labels: ${{ steps.metafull.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8964a194..63ac19c3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,7 +23,6 @@ jobs: with: go-version: ^1.19 cache: true - id: go - uses: dotnet/nbgv@master with: