Skip to content

Upgrade docker/build-push-action to v6 #562

Upgrade docker/build-push-action to v6

Upgrade docker/build-push-action to v6 #562

Workflow file for this run

name: Build
on:
push:
pull_request:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: ${{ github.event_name == 'pull_request' && 'read' || 'write' }}

Check failure on line 16 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 16, Col: 17): Unrecognized named-value: 'github'. Located at position 1 within expression: github.event_name == 'pull_request' && 'read' || 'write' .github/workflows/build.yml (Line: 16, Col: 17): Unexpected value '${{ github.event_name == 'pull_request' && 'read' || 'write' }}'
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v1
- run: zig build test --summary all
- run: zig build
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}