Skip to content

Commit

Permalink
Merge pull request #44 from MoigeMatino/add-deploy-job-ci
Browse files Browse the repository at this point in the history
ci: add deploy job to ci/cd workflow
  • Loading branch information
MoigeMatino authored Nov 18, 2024
2 parents 1e2996c + b4cafd0 commit e70b10d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,20 @@ jobs:
if: always()
run: |
docker compose down
deploy:
needs: build-and-test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Tag and push Docker image
run: |
docker tag my-fastapi-app ${{ secrets.DOCKER_HUB_USERNAME }}/my-fastapi-app:latest
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/my-fastapi-app:latest

0 comments on commit e70b10d

Please sign in to comment.