From 84d57dec4dde904a8dcdd38e65272e8a531e140b Mon Sep 17 00:00:00 2001 From: Francesco Ortame <109461666+liminalfever@users.noreply.github.com> Date: Wed, 13 Mar 2024 15:37:32 +0000 Subject: [PATCH] Edit py server action --- .github/workflows/main_istat-terra-python.yml | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main_istat-terra-python.yml b/.github/workflows/main_istat-terra-python.yml index f53bbbd..313e7b1 100644 --- a/.github/workflows/main_istat-terra-python.yml +++ b/.github/workflows/main_istat-terra-python.yml @@ -5,7 +5,11 @@ name: Terra Python CI/CD on: workflow_dispatch: - + +permissions: + id-token: write + contents: read + jobs: build: runs-on: 'ubuntu-latest' @@ -47,3 +51,25 @@ jobs: slot-name: 'production' publish-profile: ${{ secrets.AzureAppService_PublishProfile_PYTHONSERVICE }} images: 'istatcosmo.azurecr.io/cosmo-python-service:run-${{ github.run_number }}' + + deployaca: + runs-on: ubuntu-latest + needs: build + environment: + name: 'development-aca' + + steps: + - name: Azure Login + uses: Azure/login@v1.4.3 + with: + client-id: ${{ secrets.AZ_CLIENT_ID }} + tenant-id: ${{ secrets.AZ_TENANT_ID }} + subscription-id: ${{ secrets.AZ_SUBSCRIPTION_ID }} + + - name: Deploy Container App + shell: pwsh + env: + CONTAINERAPP_NAME: ${{ vars.PYTHON_CONTAINERAPP_NAME }} + CONTAINERAPP_RG: ${{ vars.TERRA_RG }} + run: | + az containerapp update --image 'istatcosmo.azurecr.io/cosmo-python-service:run-${{ github.run_number }}' -n $env:CONTAINERAPP_NAME -g $env:CONTAINERAPP_RG