Skip to content

fix: ensure IMAGE_NAME is consistently lowercased in Docker metadata … #11

fix: ensure IMAGE_NAME is consistently lowercased in Docker metadata …

fix: ensure IMAGE_NAME is consistently lowercased in Docker metadata … #11

name: Multi-Platform Docker Build

Check failure on line 1 in .github/workflows/docker-publish-multi-platform.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-publish-multi-platform.yml

Invalid workflow file

(Line: 10, Col: 15): Unexpected symbol: '|'. Located at position 19 within expression: github.repository | lower, (Line: 44, Col: 19): Unexpected symbol: '|'. Located at position 16 within expression: env.IMAGE_NAME | lower, (Line: 67, Col: 23): Unexpected symbol: '|'. Located at position 16 within expression: env.IMAGE_NAME | lower, (Line: 70, Col: 21): Unexpected symbol: '|'. Located at position 16 within expression: env.IMAGE_NAME | lower
on:
push:
tags:
- 'v*.*.*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository | lower }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 #3.11.1
- name: Log in to the Container registry
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 #3.5.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f #5.8.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME | lower }}
flavor: |
latest=false
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=sha,format=long
- name: Build and push Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 #6.18.0
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ github.event.head_commit.timestamp }}
cache-from: |
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME | lower }}:cache
type=gha
cache-to: |
type=gha,mode=max
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME | lower }}:cache,mode=max