This file contains 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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: Build and deploy container app to Azure Web App - pwabuilder-cloudapk(pre) | |
on: | |
push: | |
branches: | |
- dev | |
workflow_dispatch: null | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login with Azure CLI | |
uses: azure/login@v1 | |
with: | |
creds: | | |
{ | |
"clientId": "${{ secrets.AZURE_APP_ID }}", | |
"clientSecret": "${{ secrets.AZURE_PASSWORD }}", | |
"subscriptionId": "${{ secrets.AZURE_SUBSCRIPTION_ID }}", | |
"tenantId": "${{ secrets.AZURE_TENANT_ID }}" | |
} | |
- name: Log in to registry | |
uses: azure/docker-login@v1 | |
with: | |
login-server: https://pwabuilder.azurecr.io/ | |
username: ${{ | |
secrets.AzureAppService_ContainerUsername_c4f6902b5ee546e8847acb25a00561b6 | |
}} | |
password: ${{ | |
secrets.AzureAppService_ContainerPassword_4fbee4d970264b12bb65c9bad20ba87f | |
}} | |
- run: | | |
docker build . -t pwabuilder.azurecr.io/${{secrets.AzureAppService_ContainerUsername_c4f6902b5ee546e8847acb25a00561b6}}/cloudapk-dev:preview | |
docker push pwabuilder.azurecr.io/${{ secrets.AzureAppService_ContainerUsername_c4f6902b5ee546e8847acb25a00561b6 }}/cloudapk-dev:preview | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: pre | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Login with Azure CLI | |
uses: azure/login@v1 | |
with: | |
creds: | | |
{ | |
"clientId": "${{ secrets.AZURE_APP_ID }}", | |
"clientSecret": "${{ secrets.AZURE_PASSWORD }}", | |
"subscriptionId": "${{ secrets.AZURE_SUBSCRIPTION_ID }}", | |
"tenantId": "${{ secrets.AZURE_TENANT_ID }}" | |
} | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: pwabuilder-cloudapk | |
slot-name: pre | |
images: pwabuilder.azurecr.io/${{secrets.AzureAppService_ContainerUsername_c4f6902b5ee546e8847acb25a00561b6}}/cloudapk-dev:preview |