-
Notifications
You must be signed in to change notification settings - Fork 31
81 lines (77 loc) · 3.25 KB
/
azure_deploy.yml
File metadata and controls
81 lines (77 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Azure_Deploy_Workflow
on:
push:
branches:
- main
milestone:
types: [closed]
repository_dispatch:
types: [milestone_closed]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: "Checkout GitHub Action"
uses: actions/checkout@main
- name: "Login via Azure CLI"
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: "Build and push image"
uses: azure/docker-login@v1
with:
login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build . -t ${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-api-python:${{ github.sha }} -t ${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-api-python:latest
docker push ${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-api-python --all-tags
- name: "Deploy All to Azure Container Instances"
uses: "pierreVH2/azure-containergroup-deploy@master"
with:
resource-group: ${{ secrets.RESOURCE_GROUP }}
group-name: electionguard-demo
registry-login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
registry-username: ${{ secrets.REGISTRY_USERNAME }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
location: "east us"
containers: '[
{
"name": "electionguard-ui-app",
"image": "${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-ui:latest",
"command": "serve -l 3000 -s build",
"cpu": 0.5,
"memory": 1.5,
"ports": "3000"
},
{
"name": "electionguard-ui-storybook",
"image": "${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-ui:latest",
"command": "serve -l 6006",
"cpu": 1,
"memory": 1.5,
"ports": "6006"
},
{
"name": "electionguard-api-python-mediator",
"image": "${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-api-python:latest",
"environmentVariables": "API_MODE=\"mediator\" QUEUE_MODE=\"remote\" STORAGE_MODE=\"mongo\" PROJECT_NAME=\"ElectionGuard Mediator API\" PORT=8000 MESSAGEQUEUE_URI=\"amqp://guest:guest@electionguard-message-queue:5672\" MONGODB_URI=${{ secrets.COSMOSDB_URI }}",
"cpu": 1,
"memory": 1.5,
"ports": "8000"
},
{
"name": "electionguard-api-python-guardian",
"image": "${{ secrets.DEPLOY_REGISTRY }}.azurecr.io/electionguard-api-python:latest",
"environmentVariables": "API_MODE=\"guardian\" QUEUE_MODE=\"remote\" STORAGE_MODE=\"mongo\" PROJECT_NAME=\"ElectionGuard Guardian API\" PORT=8001 MESSAGEQUEUE_URI=\"amqp://guest:guest@electionguard-message-queue:5672\" MONGODB_URI=${{ secrets.COSMOSDB_URI }}",
"cpu": 1,
"memory": 1.5,
"ports": "8001"
},
{
"name": "electionguard-message-queue",
"image": "rabbitmq:3.8.16-management-alpine",
"cpu": 0.5,
"memory": 2,
"ports": "5672 15672"
}]'