Update docker/build-push-action action to v6 #1683
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- 'main' | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: none | |
checks: none | |
contents: none | |
deployments: none | |
issues: none | |
packages: write | |
pull-requests: none | |
repository-projects: none | |
security-events: none | |
statuses: none | |
id-token: none | |
steps: | |
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0 | |
- name: Login to GitHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # tag=v2.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- id: docker_meta | |
uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea # tag=v4.1.1 | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
flavor: | | |
latest=true | |
tags: | | |
type=sha,format=long | |
type=edge,branch=$repo.default_branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@8c0edbc76e98fa90f69d9a2c020dcb50019dc325 # tag=v2 | |
- name: push | |
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0 | |
with: | |
# platforms: linux/arm64,linux/amd64 | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
push: ${{ github.event_name != 'pull_request' }} | |
outputs: | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
sign: | |
if: github.event_name != 'pull_request' | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
actions: none | |
checks: none | |
contents: none | |
deployments: none | |
issues: none | |
packages: write | |
pull-requests: none | |
repository-projects: none | |
security-events: none | |
statuses: none | |
id-token: write | |
steps: | |
- name: Login to GitHub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # tag=v2.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: sigstore/cosign-installer@9becc617647dfa20ae7b1151972e9b3a2c338a2b # tag=v2.8.1 | |
- name: Sign the images | |
run: cosign sign ${TAGS} | |
env: | |
TAGS: ${{needs.build.outputs.tags}} | |
COSIGN_EXPERIMENTAL: 1 |