feat: azure migration #615
Workflow file for this run
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: Build and Deploy to Azure | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - azure-migration | |
| permissions: | |
| id-token: write # This is required for Azure login | |
| contents: read # This is required for actions/checkout | |
| packages: write # This is required for publishing the package | |
| jobs: | |
| build: | |
| name: Build and Push Image | |
| uses: ./.github/workflows/reusable-build.yml | |
| deploy: | |
| name: Deploy to Azure | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: production | |
| env: | |
| AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} | |
| AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} | |
| AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} | |
| AZURE_APPSVC_NAME: ${{ vars.AZURE_APPSVC_NAME }} | |
| AZURE_RESOURCE_GROUP: ${{ vars.AZURE_RESOURCE_GROUP }} | |
| steps: | |
| # Az Login | |
| - name: Az Login | |
| uses: azure/login@v1 | |
| with: | |
| client-id: ${{ env.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ env.AZURE_TENANT_ID }} | |
| subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }} | |
| # Set App Service Image to Latest | |
| - name: Set App Service Image to Latest | |
| run: | | |
| az webapp config container set \ | |
| --name ${{ env.AZURE_APPSVC_NAME }} \ | |
| --resource-group ${{ env.AZURE_RESOURCE_GROUP }} \ | |
| --container-image-name ${{ needs.build.outputs.image }} | |
| az webapp restart \ | |
| --name ${{ env.AZURE_APPSVC_NAME }} \ | |
| --resource-group ${{ env.AZURE_RESOURCE_GROUP }} | |