-
Notifications
You must be signed in to change notification settings - Fork 6
31 lines (25 loc) · 1.23 KB
/
stage-prod-swap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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