-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (60 loc) · 1.86 KB
/
orchestrator-service-build.yml
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
name: Build orchestrator service
# on:
# push:
# tags:
# - '*'
on:
push:
branches:
- main
paths:
- 'src/backend/orchestrator/**'
- 'src/backend/core/**'
- 'src/backend/go.mod'
- '.github/workflows/orchestrator-service-build.yml'
env:
RGNAME: AKS_RG
ACRNAME: cognixacr
AKSNAME: Cognix_AKS
GITHUB_SHA: ${{ github.sha }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ACR
uses: docker/login-action@v3
with:
registry: ${{ env.ACRNAME }}.azurecr.io
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
- name: Orchestrator Service Image Docker Build and Push
uses: docker/build-push-action@v2
with:
context: ./src/backend
file: ./src/backend/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.ACRNAME }}.azurecr.io/cognix/orchestratorservice:${{env.GITHUB_SHA}}
build-args: |
COGNIX_VERSION=${{env.GITHUB_SHA}}
service=orchestrator
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Get AKS kubeconfig
run: az aks get-credentials --resource-group $RGNAME --name $AKSNAME
- name: Update Orchestrator server manifest
run:
sed -ie "s/orchestratorservice:main/orchestratorservice:${{env.GITHUB_SHA}}/g" ./src/backend/orchestrator/service-deployment.yaml
- name: Deploy Orchestrator server manifests
run: |
kubectl apply -f ./src/backend/orchestrator/service-deployment.yaml
- name: Delete Orchestrator server pod
run: |
kubectl rollout restart deploy/orchestratorservice