Skip to content

Commit

Permalink
ci: publish docker image only on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kskarthik committed Apr 23, 2024
1 parent c97bf23 commit df69fd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ name: Build docker image
on:
push:
branches: [ "main" ]
tags:
- v*
pull_request:
branches: [ "main" ]

Expand Down Expand Up @@ -44,12 +46,19 @@ jobs:
- name: Test API's
run: pytest

# docker related ops
# docker related ops, only run on tags
- name: Commit the docker container
run: docker commit fin kskarthik/indian-fincodes-api:latest
if: ${{github.ref_type == 'tag'}}
run: |
docker commit fin kskarthik/indian-fincodes-api:latest
docker tag kskarthik/indian-fincodes-api:latest kskarthik/indian-fincodes-api:${{github.ref_name}}
- name: Authenticate to Docker Hub
if: ${{github.ref_type == 'tag'}}
run: docker login -u kskarthik -p ${{ secrets.DOCKER_HUB_PWD }}

- name: Push Docker Image to Hub
run: docker push kskarthik/indian-fincodes-api:latest
if: ${{github.ref_type == 'tag'}}
run: |
docker push kskarthik/indian-fincodes-api:latest
docker push kskarthik/indian-fincodes-api:${{ github.ref_name }}
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import requests as r
import requests
import threading
import time

client = meilisearch.Client("http://127.0.0.1:7700", "masterKey")

Expand Down

0 comments on commit df69fd2

Please sign in to comment.