Update github workflow actions

This commit is contained in:
Matthew Brown 2025-11-26 17:04:43 +00:00
parent 8f08b38f2c
commit 71a43e4673
3 changed files with 18 additions and 0 deletions

5
.github/workflows/build-image.yml vendored Normal file
View file

@ -0,0 +1,5 @@
- name: Build builder image
run: docker build -f Dockerfile.build -t petclinic-builder .
# - name: Build runtime image
# run: docker build -f Dockerfile.run -t ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REPO_PATH }}:${{ github.sha }} .

View file

@ -27,3 +27,10 @@ jobs:
cache: maven
- name: Build with Maven Wrapper
run: ./mvnw -B verify
- name: Build builder image
run: docker build -f Dockerfile.build -t petclinic-builder .
- name: Build runtime image
run: docker build -f Dockerfile.run -t ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REPO_PATH }}:${{ github.sha }} .

6
.github/workflows/push-image.yml vendored Normal file
View file

@ -0,0 +1,6 @@
- name: Push final image
run: |
docker push ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REPO_PATH }}:${{ github.sha }}
docker tag ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REPO_PATH }}:${{ github.sha }} \
${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REPO_PATH }}:latest
docker push ${{ secrets.DOCKER_REGISTRY_URL }}/${{ secrets.DOCKER_REPO_PATH }}:latest