Skip to content

Add timezone support, #170 (#171) #52

Add timezone support, #170 (#171)

Add timezone support, #170 (#171) #52

Workflow file for this run

name: Publish to PyPI and Docker Hub
on:
push:
tags:
- 'v*' # Trigger this workflow for tags starting with "v"
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9 # Specify the Python version
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Extract version from tag
id: get_version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Update version in pyproject.toml
run: poetry version ${{ env.version }}
- name: Update lock file
run: poetry lock
- name: Install dependencies
run: poetry install --no-root
- name: Build and Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build
poetry publish
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/mysql-ch-replicator:latest
${{ secrets.DOCKERHUB_USERNAME }}/mysql-ch-replicator:${{ env.version }}
cache-from: type=gha
cache-to: type=gha,mode=max