Skip to content

Commit fe1c920

Browse files
committed
on merge, deploy to staging. require on-demand swap to production
1 parent 7831982 commit fe1c920

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/build-and-stage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ jobs:
9191
with:
9292
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
9393
package: '.'
94-
slot-name: 'production'
94+
slot-name: ${{ vars.STAGING_SLOT_NAME }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Swap staging slot contents into production
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
promote-to-production:
8+
name: Promote to production
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: 'Production'
12+
url: 'https://${{ vars.AZURE_WEBAPP_NAME }}.azurewebsites.net/'
13+
14+
steps:
15+
- name: Log into Azure CLI with service principal
16+
uses: azure/login@v1
17+
with:
18+
creds: ${{ secrets.AZURE_CREDENTIALS }}
19+
20+
- name: Swap slots
21+
run: az webapp deployment slot swap -s ${{ vars.STAGING_SLOT_NAME }} -n ${{ vars.AZURE_WEBAPP_NAME }} -g ${{ vars.AZURE_RESOURCE_GROUP }}

0 commit comments

Comments
 (0)