Skip to content

Commit 3473525

Browse files
lsteinLincoln Stein
andauthored
[release] Add dockerhub push to the GitHub deploy script (#75)
* add dockerhub deploy to release action * fix missing "v" in the github tag --------- Co-authored-by: Lincoln Stein <[email protected]>
1 parent 926b5a3 commit 3473525

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release to PyPi
1+
name: Release to PyPi & DockerHub
22

33
on:
44
workflow_dispatch:
@@ -42,14 +42,35 @@ jobs:
4242
- name: Create GitHub Release
4343
uses: softprops/action-gh-release@v2
4444
with:
45-
tag_name: ${{ steps.get_version.outputs.version }}
45+
tag_name: v${{ steps.get_version.outputs.version }}
4646
generate_release_notes: true
4747
env:
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949

50-
- name: Publish to TestPyPI
50+
- name: Publish to PyPI
5151
uses: pypa/gh-action-pypi-publish@release/v1
5252
with:
5353
repository-url: https://upload.pypi.org/legacy/
5454
# env:
5555
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
56+
57+
- name: Log in to DockerHub
58+
uses: docker/login-action@v3
59+
with:
60+
username: ${{ secrets.DOCKERHUB_USERNAME }}
61+
password: ${{ secrets.DOCKERHUB_TOKEN }}
62+
63+
- name: Build Docker image
64+
run: |
65+
VERSION=${{ steps.get_version.outputs.version }}
66+
docker build -f docker/Dockerfile -t ${{ secrets.DOCKERHUB_USERNAME }}/photomapai:${VERSION} .
67+
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/photomapai:${VERSION} ${{ secrets.DOCKERHUB_USERNAME }}/photomapai:latest
68+
69+
- name: Push Docker image (versioned)
70+
run: |
71+
VERSION=${{ steps.get_version.outputs.version }}
72+
docker push ${{ secrets.DOCKERHUB_USERNAME }}/photomapai:${VERSION}
73+
74+
- name: Push Docker image (latest)
75+
run: |
76+
docker push ${{ secrets.DOCKERHUB_USERNAME }}/photomapai:latest

0 commit comments

Comments
 (0)