Skip to content

Change to web app

Change to web app #20

Workflow file for this run

name: Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Login to ACR
uses: docker/login-action@v2
with:
registry: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ secrets.REGISTRY_LOGIN_SERVER }}/image-api:${{ github.sha }}
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: 'Login to Azure'
uses: 'azure/login@v1'
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set Web App ACR authentication
uses: Azure/appservice-settings@v1
with:
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
app-settings-json: |
[
{
"name": "DOCKER_REGISTRY_SERVER_PASSWORD",
"value": "${{ secrets.REGISTRY_PASSWORD }}",
"slotSetting": false
},
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "${{ secrets.REGISTRY_LOGIN_SERVER }}",
"slotSetting": false
},
{
"name": "DOCKER_REGISTRY_SERVER_USERNAME",
"value": "${{ secrets.REGISTRY_USERNAME }}",
"slotSetting": false
}
]
- name: 'Deploy to Web App'
uses: azure/webapps-deploy@v2
id: deploy-to-webapp
with:
app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
images: ${{ secrets.REGISTRY_LOGIN_SERVER }}/image-api:${{ github.sha }}