Skip to content

Commit

Permalink
feat: Improve DockerHub deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Jun 22, 2024
1 parent ca3e7e2 commit 4007ca9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/deployment_on_dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
run: docker build -t drorganvidez/uvlhub:${{ github.event.release.tag_name }} -f docker/images/Dockerfile.prod .
run: docker build --build-arg VERSION_TAG=${{ github.event.release.tag_name }} -t drorganvidez/uvlhub:${{ github.event.release.tag_name }} -f docker/images/Dockerfile.prod .
env:
DOCKER_CLI_EXPERIMENTAL: enabled

- name: Push Docker image to Docker Hub
run: docker push drorganvidez/uvlhub:${{ github.event.release.tag_name }}

- name: Tag and push latest
run: docker tag drorganvidez/uvlhub:${{ github.event.release.tag_name }} drorganvidez/uvlhub:latest
run: |
docker tag drorganvidez/uvlhub:${{ github.event.release.tag_name }} drorganvidez/uvlhub:latest
docker push drorganvidez/uvlhub:latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
- run: docker push drorganvidez/uvlhub:latest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ htmlcov/
venv/
ubuntu-bionic-18.04-cloudimg-console.log
.vagrant/
nginx.prod.ssl.conf
nginx.prod.ssl.conf
.version
5 changes: 5 additions & 0 deletions docker/images/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ RUN pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir --upgrade pip \
&& apk del .build-deps

# Add an argument for version tag
ARG VERSION_TAG

# Create the .version file with the content of VERSION_TAG
RUN echo $VERSION_TAG > /app/.version

# Expose port 5000
EXPOSE 5000

0 comments on commit 4007ca9

Please sign in to comment.