This repository has been archived by the owner on Jun 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (59 loc) · 2.35 KB
/
pipeline.yaml
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
name: cd-pipeline
on: [push]
jobs:
deploy:
runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master'
environment: k8s
steps:
- uses: actions/checkout@v3
- uses: azure/setup-kubectl@v3
name: install kubectl
with:
version: v1.26.3
- name: k8s set cluster
uses: azure/k8s-set-context@v3
with:
method: service-account
k8s-url: ${{ secrets.K8S_API_URL }}
k8s-secret: ${{ secrets.K8S_SERVICEACCOUNT_SECRET }}
- name: ensure namespace
run: |
kubectl create namespace teamspeak --dry-run=client -o yaml | kubectl apply -f -
- name: switch to namespace
run: |
kubectl config set-context --current --namespace teamspeak
- name: create mariadb root secret
env:
MARIADB_ROOT_PASSWORD: ${{ secrets.MARIADB_ROOT_PASSWORD }}
run: |
kubectl delete secret root.user.teamspeak.mariadb --ignore-not-found=true
kubectl create secret generic root.user.teamspeak.mariadb --from-literal=password=${MARIADB_ROOT_PASSWORD}
- name: create teamspeak user secret
env:
TEAMSPEAK_USER_PASSWORD: ${{ secrets.TEAMSPEAK_USER_PASSWORD }}
TEAMSPEAK_USER_NAME: teamspeak
run: |
kubectl delete secret teamspeak.user.teamspeak.mariadb --ignore-not-found=true
kubectl create secret generic teamspeak.user.teamspeak.mariadb --from-literal=username=${TEAMSPEAK_USER_NAME} --from-literal=password=${TEAMSPEAK_USER_PASSWORD}
- uses: Azure/k8s-deploy@v4
name: deploy mariadb
with:
namespace: "teamspeak"
action: deploy
manifests: |
manifests/database
- name: create teamspeak metrics user secret
env:
SERVERQUERY_USERNAME: ${{ secrets.SERVERQUERY_USERNAME }}
SERVERQUERY_PASSWORD: ${{ secrets.SERVERQUERY_PASSWORD }}
run: |
kubectl delete secret teamspeak-metrics-user --ignore-not-found=true
kubectl create secret generic teamspeak-metrics-user --from-literal=username=${SERVERQUERY_USERNAME} --from-literal=password=${SERVERQUERY_PASSWORD}
- uses: Azure/k8s-deploy@v4
name: deploy teamspeak server
with:
namespace: "teamspeak"
action: deploy
manifests: |
manifests/teamspeak