Skip to content

0.5.3

0.5.3 #6

Workflow file for this run

name: publish
on:
release:
types: [created]
jobs:
build-and-publish-on-pypi:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
- name: Publish package
run : |
hatch publish -u __token__ -a ${{ secrets.PYPI_API_TOKEN }}
build-and-publish-on-ghcr:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: tests.conf.settings.demo
GHCR_IMAGE_NAME: "ghcr.io/pikhovkin/${GITHUB_REPOSITORY:10}"
TAG: ${GITHUB_REF:10}
steps:
- uses: actions/checkout@v3
- name: Docker login
run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker build -f docker/Dockerfile -t ${{ env.GHCR_IMAGE_NAME }}-demo:${{ env.TAG }} .
- name: Docker push
run: |
docker push ${{ env.GHCR_IMAGE_NAME }}-demo:${{ env.TAG }}