Deploy to Azure Container App #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Azure Container App | |
| on: | |
| workflow_run: | |
| workflows: ["Build and Push Docker Image"] | |
| types: | |
| - completed | |
| conclusion: success | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: production | |
| steps: | |
| - name: Download image tag artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: lastest-build | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| run-id: ${{ github.event.workflow_run.id }} | |
| - name: Read image tag | |
| id: read_tag | |
| run: | | |
| IMAGE_TAG=$(cat lastest-build.txt) | |
| echo "IMAGE_TAG=$IMAGE_TAG" | |
| echo "image=$IMAGE_TAG" >> $GITHUB_OUTPUT | |
| - name: Login to Azure using OIDC | |
| uses: azure/login@v2 | |
| with: | |
| client-id: ${{ vars.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ vars.AZURE_TENANT_ID }} | |
| subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
| - name: Deploy to Azure Container App | |
| run: | | |
| az containerapp update \ | |
| --name amazonia-minada-backend \ | |
| --resource-group rg-amazonia-minada-prod-brs \ | |
| --image ${{ steps.read_tag.outputs.image }} |