Reviewed-on: #1 Co-authored-by: Gabriel Sancho <gabriel.sancho13@gmail.com> Co-committed-by: Gabriel Sancho <gabriel.sancho13@gmail.com> Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
38
.gitea/workflows/build.yml
Normal file
38
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Build And Publish Production Image
|
||||
|
||||
on:
|
||||
pull_request_review:
|
||||
types: [submitted]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
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:
|
||||
github-server-url: http://gitea.lab
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Verify Docker CLI
|
||||
run: docker version
|
||||
|
||||
- name: Build all-in-one image
|
||||
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