Bump docker/build-push-action from 5 to 6 in the main group #34
Workflow file for this run
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
# build and publish the project's docker image | |
name: Docker Build | |
on: | |
create: | |
push: | |
branches: [ main ] | |
tags: [ '*' ] | |
pull_request: | |
branches: [ main ] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Extract Docker metadata | |
id: metadata | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Login to Docker registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# only run on tags | |
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
tags: ${{ steps.metadata.outputs.tags }} | |
labels: ${{ steps.metadata.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
# only run on tags | |
push: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') }} |