Skip to content

Commit

Permalink
on merge, deploy to staging. require on-demand swap to production
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHess committed Feb 9, 2024
1 parent 7831982 commit fe1c920
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ jobs:
with:
app-name: ${{ vars.AZURE_WEBAPP_NAME }}
package: '.'
slot-name: 'production'
slot-name: ${{ vars.STAGING_SLOT_NAME }}
21 changes: 21 additions & 0 deletions .github/workflows/stage-prod-swap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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: Swap slots
run: az webapp deployment slot swap -s ${{ vars.STAGING_SLOT_NAME }} -n ${{ vars.AZURE_WEBAPP_NAME }} -g ${{ vars.AZURE_RESOURCE_GROUP }}

0 comments on commit fe1c920

Please sign in to comment.