mirror of
https://github.com/e1ven/Robohash.git
synced 2025-06-23 21:35:02 +00:00

Some users have asked for an updated version in PyPI, so I'm doing some minor cleanup. No real functionality changes, just modernizing things that would be considered more standard 10+ years after this code was written. - Added note about maintenance mode in README - Cleaned up Python 3 compatibility (removed Python 2 support) - Added minimal test for image consistency - Added Docker image + GitHub workflow to build/publish it - Fixed some minor bugs and improved error handling - Added better CLI help text The project is now officially in maintenance mode as noted in the README.
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: Build and Publish Docker Image
|
|
|
|
on:
|
|
push:
|
|
# Publish when tags are pushed
|
|
tags:
|
|
- '*'
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
# github.repository as <account>/<repo>
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
jobs:
|
|
build-and-push-image:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
# Login to GitHub Container Registry
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Extract metadata for Docker
|
|
- name: Extract Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
# Build and push Docker image
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }} |