feat: update build workflow to create and publish all-in-one Docker image on approved PRs
This commit is contained in:
@@ -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 }}
|
||||
Reference in New Issue
Block a user