From 582396b13dc39acf0f599b82d3f58a8c763d0b61 Mon Sep 17 00:00:00 2001 From: Nano Taboada Date: Sun, 4 May 2025 10:58:05 -0300 Subject: [PATCH] feat(ci): update workflow to build and push Docker image to GHCR --- .github/workflows/python-app.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 74047f5..4298767 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -100,3 +100,35 @@ jobs: with: project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} coverage-reports: coverage.xml + + container: + needs: coverage + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push Docker image to GitHub Container Registry + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:main + ghcr.io/${{ github.repository }}:sha-${{ github.sha }}