-
Notifications
You must be signed in to change notification settings - Fork 235
Setting up repo environments for Somnia deployments
Van Nguyen edited this page Jul 27, 2024
·
2 revisions
As part of #2343, we added automatic test and prod deployments for Somnia, our Discord bot. This requires some setup of environments on the repo that can be a bit hard to replicate without all the knowledge.
- Please create 2 environments:
somnia-prod
andsomnia-test
using these instructions, steps 1-4 - Optionally, set
somnia-prod
to be restricted tomaster
branch to avoid incidental deployments from a bad workflow file - In each environment, create 2 secrets as follows. For real GO, you do not need to generate these secret values, instead you can find them here:
-
AZURE_CREDENTIALS
: These are the credentials we will use to deploy to our Azure Web App. You can get these by generating a Service Principal with Contributor role on the scope of the web app.- Instructions: https://learn.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=userlevel%2Caspnetcore#set-up-a-github-actions-workflow-manually
az ad sp create-for-rbac --name "myApp" --role contributor --scopes /subscriptions/<subscription-id>/resourceGroups/<group-name>/providers/Microsoft.Web/sites/<app-name> --json-auth
- Set the entire JSON object as the secret value
-
SOMNIA_CREDENTIALS
: These are the credentials of the Discord bot. You can find the template atapps/src/somnia/src/config.empty.json
, and you can get these values after creating a Discord application- Discord app instructions: https://discord.com/developers/docs/quick-start/getting-started
-
token
is the bot token.clientid
is the Application ID - Set the entire JSON object as the secret value
-