From 3e5fdf46150b9af48b9ebc2523b2e3c0661c6cc7 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 | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd-backend.yml b/.github/workflows/cd-backend.yml index d5b8c94..e87dc33 100644 --- a/.github/workflows/cd-backend.yml +++ b/.github/workflows/cd-backend.yml @@ -25,6 +25,29 @@ jobs: uses: docker/build-push-action@v6 with: push: true - tags: ${{ secrets.DOCKER_IMAGE_PATH }}:latest - cache-from: type=gha - cache-to: type=gha,mode=max + tags: ${{ secrets.DOCKER_IMAGE_PATH }}:${{ github.sha }} + cache-from: type=registry,ref=${{ secrets.DOCKER_IMAGE_PATH }}:buildcache + cache-to: type=registry,ref=${{ secrets.DOCKER_IMAGE_PATH }}:buildcache,mode=max + azure: + runs-on: ubuntu-latest + environment: battleship + permissions: + id-token: write + contents: read + steps: + - + name: Azure login + uses: azure/login@v2 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + - + name: Deploy Container + uses: azure/container-apps-deploy-action@v1 + with: + registryUrl: docker.io + containerAppName: battleship + resourceGroup: Battleship + imageToDeploy: docker.io/${{ secrets.DOCKER_IMAGE_PATH }}:${{ github.sha }} +