Skip to content

chore: bump chart version to 0.1.4 (#109) #114

chore: bump chart version to 0.1.4 (#109)

chore: bump chart version to 0.1.4 (#109) #114

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 '[A-Z]' '[a-z]')
# 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@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.formatTag.outputs.TAG }}
- name: Scan image
uses: azure/container-scan@v0
with:
image-name: ${{ env.IMAGE_NAME }}