{"id":22800847,"url":"https://github.com/colindembovsky/web-app-actions-deploy-sample","last_synced_at":"2025-04-30T19:49:28.235Z","repository":{"id":43748029,"uuid":"251097311","full_name":"colindembovsky/web-app-actions-deploy-sample","owner":"colindembovsky","description":"Sample for showing Azure Web App Release, A/B Testing and ChatOps with GitHub Actions","archived":false,"fork":false,"pushed_at":"2022-02-20T04:50:40.000Z","size":719,"stargazers_count":4,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T19:32:33.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/colindembovsky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-29T17:56:49.000Z","updated_at":"2022-02-04T16:55:46.000Z","dependencies_parsed_at":"2022-08-22T08:20:54.921Z","dependency_job_id":null,"html_url":"https://github.com/colindembovsky/web-app-actions-deploy-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colindembovsky%2Fweb-app-actions-deploy-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colindembovsky%2Fweb-app-actions-deploy-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colindembovsky%2Fweb-app-actions-deploy-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colindembovsky%2Fweb-app-actions-deploy-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colindembovsky","download_url":"https://codeload.github.com/colindembovsky/web-app-actions-deploy-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251774364,"owners_count":21641722,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-12T08:08:12.743Z","updated_at":"2025-04-30T19:49:28.210Z","avatar_url":"https://github.com/colindembovsky.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Release Azure Web Apps with A/B Testing using GitHub Actions Sample\n\nDemonstrates CI/CD for Azure Web Apps using GitHub Actions and ChatOps.\n\nI made a [video](https://www.youtube.com/watch?v=Yo6O55OQSIA) of this process.\n\n## Overview\nIn this demo, the process is as follows:\n\n1. Developer creates a branch for changes to code, and pushes changes to the branch.\n1. When the developer is ready, a PR is created to merge the changes into master.\n1. A team member will review the changes.\n1. If changes are approved, an issue comment `/deploy:{slot}` is issued. This triggers a GitHub action to:\n   - compile and unit test the code\n   - provision resources in Azure (specifically Azure Web App)\n   - deploy the packaged code to the specified `slot`\n1. After deployment to the slot, another comment is issued to route a percentage of traffic to the slot: `/route:{slot},{percentage}`\n1. A message is issued to revert the traffic monitoring in antipation of a slot swap: `/route:{slot},0`\n1. After checking changes and monitoring the traffic to the slot, a final message is issued: `/swap:{slot},production` to perform a slot swap.\n1. The PR is then merged to master to complete the loop.\n\n## ChatOps\nThe messages that are issues must be on a single line and have the following syntax:\n\n|Message|Parameters|Notes|Example|\n|---|---|---|---|\n|`/deploy:{slot}`| `slot` = slot to deploy to|Deploys the code to the specified `slot`|`/deploy:blue`|\n|`/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`|\n|`/swap:{slot1},{slot2}`| `slot1` = source slot; `slot2` = target slot|Swaps slots `slot1` and `slot2`|`/swap:blue,production`|\n\n## Learning\nThe 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.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolindembovsky%2Fweb-app-actions-deploy-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolindembovsky%2Fweb-app-actions-deploy-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolindembovsky%2Fweb-app-actions-deploy-sample/lists"}