This repository has been archived by the owner on Feb 24, 2023. It is now read-only.
forked from hesar/tractusx
-
Notifications
You must be signed in to change notification settings - Fork 21
76 lines (65 loc) · 2.28 KB
/
main.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
72
73
74
75
76
name: CDNSBuild
on:
push:
branches: [ main ]
paths:
- 'connectordns/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: |
cd connectordns
mvn --batch-mode --update-snapshots verify
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/docker-login@v1
with:
login-server: catenaxdevacr.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- run: |
docker build -t catenaxdevacr.azurecr.io/tractusx/cdns:${{ github.run_id }} .
docker push catenaxdevacr.azurecr.io/tractusx/cdns:${{ github.run_id }}
- name: Azure Kubernetes set context
uses: azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
resource-group: catenax-dev-rg
cluster-name: catenax-dev-aks-services
- name: Create imagepullsecret for Azure Container registry (ACR)
uses: azure/k8s-create-secret@v1.1
with:
namespace: cdns
container-registry-url: catenaxdevacr.azurecr.io
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: cdns-ips
- name: Baking the helm chart to generate the manifests to deploy
uses: Azure/k8s-bake@v1
with:
renderEngine: helm
helmChart: ./cdnschart/
helm-version: latest
overrides: |
image.tag:${{ github.run_id }}
id: bake
- name: Deploy app to AKS
uses: azure/k8s-deploy@v1.3
with:
manifests: ${{ steps.bake.outputs.manifestsBundle }}
images: |
catenaxdevacr.azurecr.io/tractusx/cdns:${{ github.run_id }}
imagepullsecrets: |
cdns-ips
namespace: cdns
route-method: ingress