From 52ea15a7ac3fcba4182f3f5d14d5f9033a266f11 Mon Sep 17 00:00:00 2001 From: Nils Balkow-Tychsen Date: Wed, 24 Jan 2024 15:56:30 +0100 Subject: [PATCH 1/2] add action to pub image --- .github/workflows/publish_docker_image.yml | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/publish_docker_image.yml diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml new file mode 100644 index 0000000..60ede47 --- /dev/null +++ b/.github/workflows/publish_docker_image.yml @@ -0,0 +1,27 @@ +name: Publish docker image + +on: + push: + branches: ['master'] + +env: + REGISTRY: registry.humanitec.io/public + IMAGE_NAME: sample-score-app + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build and push Docker image + uses: mr-smithers-excellent/docker-build-push@v6 + with: + image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + registry: ${{ env.REGISTRY }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + tags: latest + \ No newline at end of file From e1abdb2dd2aed887841befde81c5bdf7d864cd0b Mon Sep 17 00:00:00 2001 From: Nils Balkow-Tychsen Date: Wed, 24 Jan 2024 15:58:39 +0100 Subject: [PATCH 2/2] fix branch name --- .github/workflows/publish_docker_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_docker_image.yml b/.github/workflows/publish_docker_image.yml index 60ede47..6ed4300 100644 --- a/.github/workflows/publish_docker_image.yml +++ b/.github/workflows/publish_docker_image.yml @@ -2,7 +2,7 @@ name: Publish docker image on: push: - branches: ['master'] + branches: ['main'] env: REGISTRY: registry.humanitec.io/public