deploy-app-to-azure.yml 815 B

123456789101112131415161718192021222324252627282930313233
  1. name: Deploy app container to Azure
  2. on:
  3. push:
  4. branches: [main, master]
  5. pull_request:
  6. branches: [main, master]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. needs: Build-Docker-Image
  11. steps:
  12. - name: "Login via Azure CLI"
  13. uses: azure/login@v1
  14. with:
  15. creds: ${{ secrets.AZURE_CREDENTIALS }}
  16. - uses: azure/docker-login@v1
  17. with:
  18. login-server: ${{env.IMAGE_REGISTRY_URL}}
  19. username: ${{ github.actor }}
  20. password: ${{ secrets.GITHUB_TOKEN }}
  21. - name: Deploy web app container
  22. uses: azure/webapps-container-deploy@v1
  23. with:
  24. app-name: ${{env.AZURE_WEBAPP_NAME}}
  25. images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}}:${{ github.sha }}
  26. - name: Azure logout
  27. run: |
  28. az logout