Skip to content

chore(deps): bump docker/build-push-action from 5 to 6 (#130) #127

chore(deps): bump docker/build-push-action from 5 to 6 (#130)

chore(deps): bump docker/build-push-action from 5 to 6 (#130) #127

Workflow file for this run

---
name: publish-image
on:
push:
# Publish `main` as Docker `latest` image.
branches:
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
IMAGE_NAME: pod-image-swap-webhook
jobs:
publish-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Format Tag
id: formatTag
run: |
IMAGE_ID="ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME"
# Change all uppercase to lowercase
IMAGE_ID=$(echo "$IMAGE_ID" | tr '[:upper:]' '[:lower:]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Use Docker `latest` tag convention for `main` branch
if [ "$VERSION" == "main" ]; then
VERSION=latest
fi
echo IMAGE_ID="$IMAGE_ID"
echo VERSION="$VERSION"
echo "TAG=$IMAGE_ID:$VERSION" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.formatTag.outputs.TAG }}