Skip to content

Release Image

Release Image #5

Workflow file for this run

name: Release Image
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
copaw_version:
description: "CoPaw version (e.g. 1.2.3)"
required: true
type: string
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: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract image metadata
id: image_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=sha,prefix=
- name: Extract CoPaw metadata
id: copaw_meta
run: |
if [ -n "${{ inputs.copaw_version }}" ]; then
echo "version=${{ inputs.copaw_version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
fi
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.image_meta.outputs.tags }}
labels: ${{ steps.image_meta.outputs.labels }}
build-args: |
COPAW_VERSION=${{ steps.copaw_meta.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max