Skip to content

Deploy to Azure App Service #10

Deploy to Azure App Service

Deploy to Azure App Service #10

Workflow file for this run

name: Deploy to Azure App Service
on:
workflow_run:
workflows: ["Build and Push Docker Image"]
types:
- completed
branches: [ main ]
# Allow manual trigger
workflow_dispatch:
env:
AZURE_WEBAPP_NAME: 'tps-app-scripting-editor'
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/app-scripting-editor
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
environment:
name: 'production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Lowercase repository name
run: echo "IMAGE_NAME_LOWER=$(echo ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
images: '${{ env.IMAGE_NAME_LOWER }}:latest'