From 8d341af69d2817b56dae766f54e90ecea4334c86 Mon Sep 17 00:00:00 2001 From: Stefanuk12 <42220813+Stefanuk12@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:20:08 +0100 Subject: [PATCH] feat: add docker build to release workflow --- .github/workflows/release.yaml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 841fb1a..99afdab 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -149,4 +149,33 @@ jobs: name: v${{ env.VERSION }} draft: true prerelease: ${{ startsWith(env.VERSION, '0') }} - files: artifacts/* \ No newline at end of file + files: artifacts/* + + build-and-push-image: + runs-on: ubuntu-latest + permissions: + packages: write + needs: [ prepare ] + if: ${{ needs.prepare.outputs.found == 'false' }} + env: + VERSION: ${{ needs.prepare.outputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: https://ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: | + ghcr.io/stefanuk12/registry:latest + ghcr.io/stefanuk12/registry:v${{ env.VERSION }} + ghcr.io/stefanuk12/registry:${{ github.sha }}