Fix workflow var #25
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
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": "FORTUNE_API_URL", | |
"value": "${{ vars.FORTUNE_API_URL }}", | |
"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 }} |