Skip to content

bump version to 0.3.7 and update dependencies in pyproject.toml #10

bump version to 0.3.7 and update dependencies in pyproject.toml

bump version to 0.3.7 and update dependencies in pyproject.toml #10

# Leoma Subnet - Docker Build and Push
#
# This workflow builds and pushes the Docker image to Docker Hub
# whenever code is pushed to the main branch.
#
# Validators using Watchtower will automatically pull the new image.
#
# Setup:
# 1. Create a Docker Hub account and repository
# 2. Create an access token at https://hub.docker.com/settings/security
# 3. Add secrets to your GitHub repo (Settings > Secrets > Actions):
# - DOCKERHUB_USERNAME: Your Docker Hub username
# - DOCKERHUB_TOKEN: Your Docker Hub access token
name: Build and Push Docker Image
on:
push:
branches:
- main
- master
# Only rebuild when relevant files change
paths:
- 'leoma.py'
- 'pyproject.toml'
- 'Dockerfile'
- '.github/workflows/docker-publish.yml'
# Allow manual trigger for testing
workflow_dispatch:
env:
REGISTRY: docker.io
# Change this to your Docker Hub username and repo name
# Format: username/repository
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
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 Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# Tag as 'latest' for default branch
type=raw,value=latest,enable={{is_default_branch}}
# Tag with git SHA for rollback capability
type=sha,prefix=
# Tag with branch name
type=ref,event=branch
# Tag with version if tagged
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Cache layers for faster builds
cache-from: type=gha
cache-to: type=gha,mode=max
# Build for both AMD64 and ARM64
platforms: linux/amd64,linux/arm64
- name: Generate build summary
run: |
echo "## Docker Image Published 🐳" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Image:** \`${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Validators running with Watchtower will automatically update within 5 minutes." >> $GITHUB_STEP_SUMMARY