-
Notifications
You must be signed in to change notification settings - Fork 0
/
AKS-dev-pipeline.yml
50 lines (43 loc) · 1.68 KB
/
AKS-dev-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
47
48
49
50
name: AKS dev CI/CD pipeline
on:
push:
branches: [ master ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
# checkout the repo
- name: 'Checkout GitHub Action'
uses: actions/checkout@master
- 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 -f Dockerfile . -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/ct-server:latest -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/ct-server:latest
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/ct-server:latest
- uses: Azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CRED_K8S }}
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.RESOURCE_GROUP_K8S }}
- uses: Azure/k8s-create-secret@v1
with:
container-registry-url: ${{ secrets.REGISTRY_LOGIN_SERVER }}
container-registry-username: ${{ secrets.REGISTRY_USERNAME }}
container-registry-password: ${{ secrets.REGISTRY_PASSWORD }}
secret-name: ct-server-secret
- uses: Azure/k8s-deploy@v1
with:
manifests: |
manifests/deployment.yml
images: |
${{ secrets.REGISTRY_LOGIN_SERVER }}/ct-server:latest
imagepullsecrets: |
ct-server-secret