Skip to content

chore(deps): bump docker/build-push-action from 6.19.2 to 7.0.0 #460

chore(deps): bump docker/build-push-action from 6.19.2 to 7.0.0

chore(deps): bump docker/build-push-action from 6.19.2 to 7.0.0 #460

Workflow file for this run

name: build
on:
pull_request:
branches:
- main
permissions: {}
jobs:
build-snapshot:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: stable
- uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
id: goreleaser
with:
version: latest
args: build --clean --verbose --single-target --snapshot
- name: tar up binaries
run: tar -cvf dist.tar dist
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
path: dist.tar
build-image:
if: github.actor != 'dependabot[bot]'
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs: build-snapshot
strategy:
matrix:
binary:
- go-cli-github
- another-binary
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
- name: untar binaries
run: tar -xvf dist.tar
- name: Login to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx to support SBOM generation
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
- name: Get Docker metadata
id: docker_metadata
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
with:
images: ghcr.io/${{ github.repository }}/${{ matrix.binary }}
- name: Build and push ${{ matrix.binary }} container image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
push: true
sbom: true # relies on docker/setup-buildx-action above
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}
file: Dockerfile
build-args: |
BINARY=${{ matrix.binary }}
TARGETPLATFORM=${{ matrix.binary }}_linux_amd64_v1
context: dist
check-tag:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- id: ccv
uses: smlx/ccv@7318e2f25a52dcd550e75384b84983973251a1f8 # v0.10.0
with:
write-tag: false
- run: |
echo "new-tag=$NEW_TAG"
echo "new-tag-version=$NEW_TAG_VERSION"
env:
NEW_TAG: ${{steps.ccv.outputs.new-tag}}
NEW_TAG_VERSION: ${{steps.ccv.outputs.new-tag-version}}