Merge pull request #120 from pwa-builder/dev #44
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 | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
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.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASS }} | |
- run: | | |
docker build . -t pwabuilder.azurecr.io/${{ secrets.REGISTRY_USER }}/cloudapk-prod:staging | |
docker push pwabuilder.azurecr.io/${{ secrets.REGISTRY_USER }}/cloudapk-prod:staging | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
environment: | |
name: staging | |
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: staging | |
images: pwabuilder.azurecr.io/${{ secrets.REGISTRY_USER }}/cloudapk-prod:staging |