-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.85 KB
/
twitchbotorchestrator-service.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
name: TwitchBotOrchestrator Service deploy
on:
push:
branches: [ master ]
paths:
- 'TwitchSoft/TwitchSoft.Shared/**'
- 'TwitchSoft/TwitchSoft.TwitchBotOrchestrator/**'
# Environment variables available to all jobs and steps in this workflow
env:
CLUSTER_NAME: ${{ secrets.CLUSTER_NAME }}
CLUSTER_RESOURCE_GROUP: ${{ secrets.CLUSTER_RESOURCE_GROUP }}
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }}
IMAGE_TAG: ${{ github.sha }}
jobs:
build-twitchbotorchestrator:
name: TwitchBotOrchestrator service build
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Azure Container Registry login
- name: ACR Login
uses: Azure/docker-login@v1
with:
login-server: ${{ env.DOCKER_REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
# Build & Push image to ACR
- name: Build image
run: |
docker build -f TwitchSoft/TwitchSoft.TwitchBotOrchestrator/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/twitchsofttwitchbotorchestrator:${{ env.IMAGE_TAG }} TwitchSoft
- name: Push image
run: |
docker push ${{ env.DOCKER_REGISTRY }}/twitchsofttwitchbotorchestrator:${{ env.IMAGE_TAG }}
# Install helm
- name: Helm tool installer
uses: Azure/setup-helm@v1
# Set the target Azure Kubernetes Service (AKS) cluster.
- uses: azure/aks-set-context@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ env.CLUSTER_NAME }}
resource-group: ${{ env.CLUSTER_RESOURCE_GROUP }}
# Upgrade chart
- name: Helm Upgrade
run: |
helm upgrade ts-twitchbotorchestrator ./TwitchSoft/TwitchSoft.TwitchBotOrchestrator/charts/twitchsofttwitchbotorchestrator/ --set image.tag=${{ env.IMAGE_TAG }}