Skip to content

Commit

Permalink
Update dockerhub tags action and coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
san99tiago committed Aug 28, 2023
1 parent 145d1e2 commit 45dc88e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,36 @@ jobs:
- name: Run tests
run: poetry run poe test-unit

- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: htmlcov

docker:
name: Build and Push to DockerHub
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: san99tiago/fastapi-docker-github-actions

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: src
push: true
tags: san99tiago/fastapi-docker-github-actions:latest
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 45dc88e

Please sign in to comment.