From de126721381e37af9a741c2838a3e2b1a64bc04e Mon Sep 17 00:00:00 2001 From: sparshg <43041139+sparshg@users.noreply.github.com> Date: Thu, 26 Sep 2024 00:01:37 +0530 Subject: [PATCH] add cd --- .github/workflows/cd-backend.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd-backend.yml b/.github/workflows/cd-backend.yml index d5b8c94..0f4e983 100644 --- a/.github/workflows/cd-backend.yml +++ b/.github/workflows/cd-backend.yml @@ -25,6 +25,20 @@ jobs: uses: docker/build-push-action@v6 with: push: true - tags: ${{ secrets.DOCKER_IMAGE_PATH }}:latest + tags: ${{ secrets.DOCKER_IMAGE_PATH }}:${{ github.sha }} cache-from: type=gha - cache-to: type=gha,mode=max + cache-to: type=gha,mode=max + - + name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + - + name: Deploy Container + uses: azure/container-apps-deploy-action@v1 + with: + acrName: dockerhub + containerAppName: battleship + resourceGroup: Battleship + imageToDeploy: ${{ secrets.DOCKER_IMAGE_PATH }}:${{ github.sha }} +