Skip to content

Commit

Permalink
Add Docker image publishing to workflow
Browse files Browse the repository at this point in the history
This update enhances the existing GitHub Actions workflow by introducing steps to build, tag, and push a Docker image alongside the Python package. The Docker image is built from the repository, tagged, and pushed to Docker Hub, ensuring continuous deployment and consistency across environments.
  • Loading branch information
iosefa committed Dec 3, 2024
1 parent cf835bd commit 0e70339
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python Package
name: Publish Python Package and Docker Image

on:
push:
Expand Down Expand Up @@ -28,4 +28,27 @@ jobs:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/* -u __token__ -p $PYPI_TOKEN
twine upload dist/* -u __token__ -p $PYPI_TOKEN
docker:
runs-on: ubuntu-latest
needs: release

steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: docker build -t pyforestscan .

- name: Tag Docker image
run: docker tag pyforestscan iosefa/pyforestscan:latest

- name: Push Docker image
run: docker push iosefa/pyforestscan:latest

0 comments on commit 0e70339

Please sign in to comment.