Skip to content

Bump docker/build-push-action from 5 to 6 (#37) #50

Bump docker/build-push-action from 5 to 6 (#37)

Bump docker/build-push-action from 5 to 6 (#37) #50

Workflow file for this run

name: Build Docker image
on:
push:
branches: ["master"] # Publish as Docker "latest"
tags: ["*"]
pull_request:
# Only rebuild Docker images if a PR affects it specifically
paths:
- Dockerfile
- docker-compose.yaml
- .github/workflows/docker.yml
jobs:
lint-dockerfile:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@v4
- uses: hadolint/hadolint-action@v3.1.0
build:
runs-on: ubuntu-latest
if: >-
!(
contains(github.event.head_commit.message, '[skip build]') ||
contains(github.event.head_commit.message, '[build skip]')
)
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
outputs:
tags: ${{ steps.meta.outputs.tags }}
json: ${{ steps.meta.outputs.json }}
steps:
- uses: docker/setup-buildx-action@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=${{ github.ref == 'refs/heads/master' }}
tags: |
type=ref,event=tag
type=sha,format=long
- uses: docker/login-action@v3
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BOT_REVISION=${{ github.sha }}
pull: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
sbom: ${{ github.event_name == 'push' }}