Skip to content

chore: bump version to 0.1.0a2 #84

chore: bump version to 0.1.0a2

chore: bump version to 0.1.0a2 #84

Workflow file for this run

name: Docker Release
on:
push:
tags:
- 'v*'
env:
REGISTRY: docker.io
IMAGE_NAME: iconben/z-image-studio
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
include:
- platform: linux/amd64
platform_tag: amd64
- platform: linux/arm64
platform_tag: arm64
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check disk space
run: |
echo "=== Disk Space Before Build ==="
df -h
echo ""
echo "=== Docker Disk Usage ==="
docker system df || true
- name: Clean up Docker cache and runner temp
run: |
docker system df || true
docker builder prune -af || true
rm -rf /home/runner/.cache/pip
rm -rf /home/runner/actions-runner/_work/_tool
rm -rf /home/runner/actions-runner/_work/_temp
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set version tag
if: github.event_name != 'pull_request'
run: echo "VERSION_TAG=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Build and push Docker image
id: build
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.platform_tag }}-latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.platform_tag }}-${{ env.VERSION_TAG }}
cache-from: type=gha,scope=${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
build-args: |
PYTHON_VERSION=3.11-slim-bookworm
- name: Clean up after build
if: always()
run: |
docker system df || true
docker builder prune -af || true
rm -rf /home/runner/.cache/pip
rm -rf /home/runner/actions-runner/_work/_tool
rm -rf /home/runner/actions-runner/_work/_temp
manifest:
needs: build
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' && success()
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set version tag
run: echo "VERSION_TAG=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Create and push manifest using imagetools
run: |
# Create and push manifest for version tag using imagetools (works with remote images)
docker buildx imagetools create \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:amd64-latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:arm64-latest \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION_TAG }}
# Create and push manifest for latest tag
docker buildx imagetools create \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:amd64-latest \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:arm64-latest \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Clean up platform images after manifest
run: |
docker rmi ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:amd64-latest || true
docker rmi ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:arm64-latest || true
docker image prune -f || true