feat: update build workflow to create and publish all-in-one Docker image on approved PRs
Some checks failed
CI / Frontend Tests (pull_request) Has been cancelled
CI / Backend Tests (pull_request) Has been cancelled

This commit is contained in:
2026-03-27 16:18:25 -03:00
parent 6305a8e95e
commit d6de131a9b
4 changed files with 29 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
name: Build Production Image
name: Build And Publish Production Image
on:
pull_request_review:
@@ -6,9 +6,12 @@ on:
jobs:
build:
name: Build Production Image
name: Build And Publish Production Image
if: github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'main'
runs-on: ubuntu-latest
env:
REGISTRY: gitea.lab
IMAGE_NAME: sancho41/condado-newsletter
steps:
- uses: actions/checkout@v4
with:
@@ -19,4 +22,17 @@ jobs:
run: docker version
- name: Build all-in-one image
run: docker build -t condado-newsletter:latest -f Dockerfile.allinone .
run: docker build -t condado-newsletter:latest -f Dockerfile.allinone .
- name: Log in to Gitea container registry
run: echo "${{ secrets.GITEA_REGISTRY_PASSWORD }}" | docker login ${REGISTRY} -u "${{ secrets.GITEA_REGISTRY_USERNAME }}" --password-stdin
- name: Tag registry images
run: |
docker tag condado-newsletter:latest ${REGISTRY}/${IMAGE_NAME}:latest
docker tag condado-newsletter:latest ${REGISTRY}/${IMAGE_NAME}:${{ github.sha }}
- name: Push registry images
run: |
docker push ${REGISTRY}/${IMAGE_NAME}:latest
docker push ${REGISTRY}/${IMAGE_NAME}:${{ github.sha }}