Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release Docker Image

on:
push:
branches:
- main
paths:
- docker/Dockerfile
- bindings/python/pyproject.toml
workflow_dispatch:
inputs:
tag:
description: 'Image tag (e.g. v1.0.1). Leave empty to use version from pyproject.toml'
required: false
type: string

permissions:
contents: read

jobs:
build-and-push:
name: Build and push Docker image
if: github.repository == 'lightseekorg/smg'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6

- name: Determine version tag
id: version
run: |
if [[ -n "${{ inputs.tag }}" ]]; then
VERSION="${{ inputs.tag }}"
else
VERSION=$(grep -m1 '^version = ' bindings/python/pyproject.toml | sed 's/version = "\(.*\)"/\1/')
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "Using 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 Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
push: true
tags: |
lightseekorg/smg:${{ steps.version.outputs.version }}
lightseekorg/smg:latest
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64