|
1 | 1 | { |
2 | 2 | "cells": [ |
3 | 3 | { |
| 4 | + "attachments": {}, |
4 | 5 | "cell_type": "markdown", |
5 | 6 | "id": "1ccf7ea5-1abe-4401-a8c7-64bbfc057425", |
6 | 7 | "metadata": {}, |
|
9 | 10 | ] |
10 | 11 | }, |
11 | 12 | { |
| 13 | + "attachments": {}, |
12 | 14 | "cell_type": "markdown", |
13 | 15 | "id": "78574a83-1d13-4e99-be84-ddcc5f2c011e", |
14 | 16 | "metadata": {}, |
|
23 | 25 | ] |
24 | 26 | }, |
25 | 27 | { |
| 28 | + "attachments": {}, |
26 | 29 | "cell_type": "markdown", |
27 | 30 | "id": "0a8858d8-c89c-4985-9164-b79cf9c530e3", |
28 | 31 | "metadata": {}, |
|
31 | 34 | ] |
32 | 35 | }, |
33 | 36 | { |
| 37 | + "attachments": {}, |
34 | 38 | "cell_type": "markdown", |
35 | 39 | "id": "3db318f3-f0f1-4328-a82e-9bb7f2a0eddf", |
36 | 40 | "metadata": {}, |
|
48 | 52 | ] |
49 | 53 | }, |
50 | 54 | { |
| 55 | + "attachments": {}, |
51 | 56 | "cell_type": "markdown", |
52 | 57 | "id": "e398cb34-3735-40ca-8dbf-3c50582e2213", |
53 | 58 | "metadata": {}, |
|
56 | 61 | ] |
57 | 62 | }, |
58 | 63 | { |
| 64 | + "attachments": {}, |
59 | 65 | "cell_type": "markdown", |
60 | 66 | "id": "f2905d00-c1c4-4fa8-8b4e-23c6fd0c1acc", |
61 | 67 | "metadata": {}, |
|
68 | 74 | ] |
69 | 75 | }, |
70 | 76 | { |
| 77 | + "attachments": {}, |
71 | 78 | "cell_type": "markdown", |
72 | 79 | "id": "25987e8c-c5fe-45c2-8547-b0f66b3faf0d", |
73 | 80 | "metadata": {}, |
|
76 | 83 | ] |
77 | 84 | }, |
78 | 85 | { |
| 86 | + "attachments": {}, |
79 | 87 | "cell_type": "markdown", |
80 | 88 | "id": "d31a7289-ca58-4bec-a977-aac3f755ea7f", |
81 | 89 | "metadata": {}, |
|
84 | 92 | ] |
85 | 93 | }, |
86 | 94 | { |
| 95 | + "attachments": {}, |
87 | 96 | "cell_type": "markdown", |
88 | 97 | "id": "20c1936c-d084-4694-97eb-1ebd21fd5fe1", |
89 | 98 | "metadata": {}, |
|
107 | 116 | ] |
108 | 117 | }, |
109 | 118 | { |
| 119 | + "attachments": {}, |
110 | 120 | "cell_type": "markdown", |
111 | 121 | "id": "8ba1f125-2cc7-48ca-a047-5054f2f4ed37", |
112 | 122 | "metadata": {}, |
|
115 | 125 | ] |
116 | 126 | }, |
117 | 127 | { |
| 128 | + "attachments": {}, |
118 | 129 | "cell_type": "markdown", |
119 | 130 | "id": "b9cb19fc-cd64-428c-8f2b-1963ff9fc4fb", |
120 | 131 | "metadata": {}, |
|
132 | 143 | ] |
133 | 144 | }, |
134 | 145 | { |
| 146 | + "attachments": {}, |
| 147 | + "cell_type": "markdown", |
| 148 | + "id": "e6f4abc9", |
| 149 | + "metadata": {}, |
| 150 | + "source": [ |
| 151 | + "# Build and deploy with GitHub Actions" |
| 152 | + ] |
| 153 | + }, |
| 154 | + { |
| 155 | + "attachments": {}, |
| 156 | + "cell_type": "markdown", |
| 157 | + "id": "c8cc7d8e", |
| 158 | + "metadata": {}, |
| 159 | + "source": [ |
| 160 | + "if you don't want to build and deploy all the components manually, a GitHub automated CI pipeline is provided in `.github/workflows/main_gptsmartsearch_apps.yml`. Some notes about the CI pipeline design:\n", |
| 161 | + "- It uses a \"branch per environment approach\". The deploy environment name is computed at 'runtime' based on a branch/env-name mapping logic in the \"set environment for branch\" step (line 29). The current implemented logic maps everything to a dev like environment. Therefore on each git push on the `main branch` the pipeline is triggered trying to deploy to an environment called `Development`. For more info about GitHub environments and how to set specific env variables and secrets read [here](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment).\n", |
| 162 | + "- GitHub environment variables and secrets are used to configure development environment specific configuration. They need to be configured manually in github repository settings:\n", |
| 163 | + " - `secrets.AZUREAPPSERVICE_X_PUBLISHPROFILE` is used to store the azure app service publish profile configuration securely.\n", |
| 164 | + " - `vars.AZURE_WEBAPP_X_NAME` is used to store the azure web app resource name generated during infra arm deployment.\n", |
| 165 | + "- Python dependencies installation is disabled during build phase as azure web apps are currently configured with SCM_DO_BUILD_DURING_DEPLOYMENT. There is an env properties that can be used to activate dependencies resolution during build job. Just set `DO_BUILD_DURING_DEPLOYMENT : false `.\n", |
| 166 | + "\n", |
| 167 | + "To properly configure automated build and deploy for both backend and frontend components follow below steps:\n", |
| 168 | + " \n", |
| 169 | + " 1. Go to your forked repository in GitHub and create an [environment]((https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment)) called 'Development' (yes this exact name; don't change it). If you want to change the environment name, add new branches and environments or change the current branch/env mapping you can do that, but make sure to change the pipeline code accordingly in `.github/workflows/main_gptsmartsearch_apps.yml` (starting line 29)\n", |
| 170 | + " 2. Create 'Development' environment [secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) for both frontend and backend azure web apps [publish profiles]((https://learn.microsoft.com/en-us/visualstudio/azure/how-to-get-publish-profile-from-azure-app-service?view=vs-2022)). You'll need to copy paste the xml content from the .PublishSettings file into the secret value:\n", |
| 171 | + " - Create a secret with name `AZUREAPPSERVICE_BACKEND_PUBLISHPROFILE` and set the Value field to publish profile of the azure web app you created using 'Deploy to Azure' button in `apps/backend/README.md`\n", |
| 172 | + " - Create a secret with name `AZUREAPPSERVICE_FRONTEND_PUBLISHPROFILE` and set the Value field to publish profile of the azure web app you created using 'Deploy to Azure' button in `apps/frontend/README.md`\n", |
| 173 | + "3. Create 'Development' environment [variables](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-an-environment) for both frontend and backend azure web app resource names:\n", |
| 174 | + " - Create a variable with name `AZURE_WEBAPP_BACKEND_NAME` and set the Value field to the azure web app resource name you created using 'Deploy to Azure' button in `apps/backend/README.md`\n", |
| 175 | + " - Create a variable with name `AZURE_WEBAPP_FRONTEND_NAME` and set the Value field to the azure web app resource name you created using 'Deploy to Azure' button in `apps/frontend/README.md`\n", |
| 176 | + "4. For each commit you push check the status of the triggered pipeline in the GitHub Actions tab, you should see a pipeline has been triggered for the specific commit. If everything is ok you should see green checkmark on both build and deploy jobs in the pipeline detail like below:\n", |
| 177 | + "\n", |
| 178 | + "\n" |
| 179 | + ] |
| 180 | + }, |
| 181 | + { |
| 182 | + "attachments": {}, |
135 | 183 | "cell_type": "markdown", |
136 | 184 | "id": "e0301fa7-1eb9-492a-918d-5c36ca5cce90", |
137 | 185 | "metadata": {}, |
|
140 | 188 | ] |
141 | 189 | }, |
142 | 190 | { |
| 191 | + "attachments": {}, |
143 | 192 | "cell_type": "markdown", |
144 | 193 | "id": "bdcdefab-7056-4990-b938-8e82b8dd9501", |
145 | 194 | "metadata": {}, |
|
0 commit comments