From d15fa4095c8fd0a004f4744e0a1eb2cf39e04492 Mon Sep 17 00:00:00 2001 From: Thea Hvalen Thodesen Date: Thu, 11 Apr 2024 10:42:56 +0200 Subject: [PATCH] KURSP-1162: Tag docker image with git hash and latest --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2080f60..7bb18a3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,7 +82,7 @@ jobs: run: | if [ "$GITHUB_REF" = "refs/heads/staging" ] then - docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api-staging + docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api-staging:$GITHUB_SHA -t $AZURE_CONTAINER_REGISTRY/statistics-api-staging:latest az webapp config appsettings set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} -g $AZURE_RESOURCE_GROUP -n $AZURE_APP_NAME --slot staging --settings \ "CANVAS_ACCESS_KEY=${{ secrets.CANVAS_ACCESS_KEY }}" \ "DB_PASSWORD=${{ secrets.STAGING_DB_PASSWORD }}" \ @@ -97,7 +97,7 @@ jobs: docker push $AZURE_CONTAINER_REGISTRY/statistics-api-staging elif [ "$GITHUB_REF" = "refs/heads/master" ] then - docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api + docker build --build-arg WEBSITES_PORT=$WEBSITES_PORT . -f Dockerfile -t $AZURE_CONTAINER_REGISTRY/statistics-api:$GITHUB_SHA -t $AZURE_CONTAINER_REGISTRY/statistics-api:latest az webapp config appsettings set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }} -g $AZURE_RESOURCE_GROUP -n $AZURE_APP_NAME --settings \ "CANVAS_ACCESS_KEY=${{ secrets.CANVAS_ACCESS_KEY }}" \ "DB_PASSWORD=${{ secrets.DB_PASSWORD }}" \