deleted src folder #26
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: | |
| push: | |
| branches: | |
| - main # Trigger workflow on push to the main branch | |
| workflow_dispatch: # Enable manual trigger | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v3 | |
| - name: Log in to Azure | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS_DEV }} | |
| - name: Log in to Azure Container Registry | |
| run: | | |
| az acr login --name ${{ secrets.ACR_NAME }} | |
| - name: Build and Push Docker Image | |
| run: | | |
| docker build -t ${{ secrets.ACR_NAME }}.azurecr.io/pythonapiapptemp:latest -f Dockerfile_root . | |
| docker push ${{ secrets.ACR_NAME }}.azurecr.io/pythonapiapptemp:latest | |
| deploy-to-containerapp: | |
| runs-on: ubuntu-latest | |
| needs: build-and-push # Run this job after the build-and-push job | |
| steps: | |
| - name: Log in to Azure | |
| uses: azure/login@v1 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS_DEV }} | |
| - name: Deploy to Azure Container App | |
| run: | | |
| az containerapp update \ | |
| --name ${{ secrets.CONTAINER_APP_NAME }} \ | |
| --resource-group ${{ secrets.RESOURCE_GROUP_NAME }} \ | |
| --image ${{ secrets.ACR_NAME }}.azurecr.io/pythonapiapptemp:latest |