Swap staging slot contents into production #4
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: Swap staging slot contents into production | |
on: | |
workflow_dispatch: | |
jobs: | |
promote-to-production: | |
name: Promote to production | |
runs-on: ubuntu-latest | |
environment: | |
name: 'Production' | |
url: 'https://${{ vars.AZURE_WEBAPP_NAME }}.azurewebsites.net/' | |
steps: | |
- name: Log into Azure CLI with service principal | |
uses: azure/login@v1 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
- name: Change docs link to prod and restart | |
run: | | |
az webapp config appsettings set --resource-group steeltoe --name www-steeltoe --slot Staging --settings DocsSite__BaseAddress=https://docs.steeltoe.io | |
az webapp restart --resource-group steeltoe --name www-steeltoe --slot Staging | |
- name: Swap slots | |
run: az webapp deployment slot swap -s ${{ vars.STAGING_SLOT_NAME }} -n ${{ vars.AZURE_WEBAPP_NAME }} -g ${{ vars.AZURE_RESOURCE_GROUP }} | |
- name: Change docs link to staging and restart | |
run: | | |
az webapp config appsettings set --resource-group steeltoe --name www-steeltoe --slot Staging --settings DocsSite__BaseAddress=https://docs-staging.steeltoe.io | |
az webapp restart --resource-group steeltoe --name www-steeltoe --slot Staging |