-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.57 KB
/
development-pipeline.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
name: development-pipeline
on:
pull_request:
types:
- closed
branches:
- 'develop'
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: 'Set up Kubernetes'
uses: azure/aks-set-context@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
- 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.REGISTRY_LOGIN_SERVER }}/whatnow:${{ github.sha }} -f ./docker/Dockerfile .
docker tag ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnow:${{ github.sha }} ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnow:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnow:${{ github.sha }}
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/whatnow:latest
- name: 'Deploy to AKS with Helm'
run: |
helm upgrade --install whatnow-backoffice ./helm-chart-backoffice \
--namespace ${{ secrets.AKS_CLUSTER_NAMESPACE }} \
--create-namespace