Skip to content

Publish PYPI & DOCKER Images #4

Publish PYPI & DOCKER Images

Publish PYPI & DOCKER Images #4

Workflow file for this run

name: Publish PYPI & DOCKER Images
on: [workflow_dispatch]
jobs:
push_to_pypi:
runs-on: ubuntu-latest
name: pypi
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the output time
run: |
pip3 install twine
cd gcastle
pip3 install -r ./requirements.txt
python3 setup.py sdist bdist_wheel
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/*
ls dist/*
push_to_dockerhub:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: set tags
run: |
cd gcastle
LABELS=$(python -c 'import web; print(web.__version__)')
echo "::set-output name=TAGS::gcastle/castleboard:$LABELS"
cd ..
id: docker_images
- name: Push to Docker Hub
uses: docker/build-push-action@v2
with:
context: ./gcastle
file: ./gcastle/docker/Dockerfile.castleboard
push: true
tags: ${{steps.docker_images.outputs.TAGS}}