From 5b7151c9d3e814e8ae8dec53d30c6c9572b76f09 Mon Sep 17 00:00:00 2001 From: Salem Ba-Rabuod Date: Sun, 19 Jul 2026 20:33:57 +0200 Subject: [PATCH] add: build image in ci.yml --- .github/workflows/ci.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfd1d76..34988b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,4 +36,24 @@ jobs: DB_URL: jdbc:postgresql://localhost:5432/testdb DB_USERNAME: postgres DB_PASSWORD: postgres - RESEND_API: test-key-not-real \ No newline at end of file + RESEND_API: test-key-not-real + + build-and-push: + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - name: Log in to GHCR + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin + - name: Build image + run: > + docker build + -t ghcr.io/barboud/tickets:latest + -t ghcr.io/barboud/tickets:${{ github.sha }} + . + - name: Push image + run: docker push --all-tags ghcr.io/barboud/tickets \ No newline at end of file