https://github.com/colindembovsky/web-app-actions-deploy-sample
Sample for showing Azure Web App Release, A/B Testing and ChatOps with GitHub Actions
https://github.com/colindembovsky/web-app-actions-deploy-sample
Last synced: about 1 year ago
JSON representation
Sample for showing Azure Web App Release, A/B Testing and ChatOps with GitHub Actions
- Host: GitHub
- URL: https://github.com/colindembovsky/web-app-actions-deploy-sample
- Owner: colindembovsky
- License: mit
- Created: 2020-03-29T17:56:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-02-20T04:50:40.000Z (over 4 years ago)
- Last Synced: 2025-03-30T19:32:33.562Z (about 1 year ago)
- Language: HTML
- Homepage:
- Size: 702 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Release Azure Web Apps with A/B Testing using GitHub Actions Sample
Demonstrates CI/CD for Azure Web Apps using GitHub Actions and ChatOps.
I made a [video](https://www.youtube.com/watch?v=Yo6O55OQSIA) of this process.
## Overview
In this demo, the process is as follows:
1. Developer creates a branch for changes to code, and pushes changes to the branch.
1. When the developer is ready, a PR is created to merge the changes into master.
1. A team member will review the changes.
1. If changes are approved, an issue comment `/deploy:{slot}` is issued. This triggers a GitHub action to:
- compile and unit test the code
- provision resources in Azure (specifically Azure Web App)
- deploy the packaged code to the specified `slot`
1. After deployment to the slot, another comment is issued to route a percentage of traffic to the slot: `/route:{slot},{percentage}`
1. A message is issued to revert the traffic monitoring in antipation of a slot swap: `/route:{slot},0`
1. After checking changes and monitoring the traffic to the slot, a final message is issued: `/swap:{slot},production` to perform a slot swap.
1. The PR is then merged to master to complete the loop.
## ChatOps
The messages that are issues must be on a single line and have the following syntax:
|Message|Parameters|Notes|Example|
|---|---|---|---|
|`/deploy:{slot}`| `slot` = slot to deploy to|Deploys the code to the specified `slot`|`/deploy:blue`|
|`/route:{slot},{percentage}`| `slot` = slot to deploy to; `percentage` = percentage of traffic to route to slot|Routes `percentage` of traffic to the `slot`|`/route:blue,20`|
|`/swap:{slot1},{slot2}`| `slot1` = source slot; `slot2` = target slot|Swaps slots `slot1` and `slot2`|`/swap:blue,production`|
## Learning
The biggest gotcha is that because the trigger is `issue_comment` and not `pull_request`, the code that is checked out is the current `master` code. I had to update the `deploy` action to fetch the code from the PR so that it would deploy that version of the code rather than the `master` code.