Skip to content

🚀 Release Docker Image #4

🚀 Release Docker Image

🚀 Release Docker Image #4

Workflow file for this run

#
# Copyright 2024-2025 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: 🚀 Release Docker Image
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., 4.1.0)"
required: true
default: "latest"
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./tools/github-actions/setup-deps
- name: Install tools
run: make tools
- name: Build UI
run: make ui-build
- name: Build project
run: make build
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
# Remove 'v' prefix if present
VERSION=${VERSION#v}
else
VERSION="${{ github.event.inputs.version }}"
fi
echo "BUILD_VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "📦 Building version: $VERSION"
- 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: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/jmanus
tags: |
type=raw,value=${{ steps.version.outputs.BUILD_VERSION }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./deploy/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_VERSION=${{ steps.version.outputs.BUILD_VERSION }}
- name: Image digest
run: echo ${{ steps.meta.outputs.digest }}
- name: Release summary
run: |
echo "🎉 Docker image released successfully!"
echo "📦 Version: ${{ steps.version.outputs.BUILD_VERSION }}"
echo "🏷️ Tags: ${{ steps.meta.outputs.tags }}"
echo "📋 Digest: ${{ steps.meta.outputs.digest }}"