-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (35 loc) · 1.56 KB
/
push-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
name: CI for Merge on master/main
on:
push:
tags:
- v*
branches: [ master, main ]
env:
GKE_USER: ${{ secrets.GKE_SERVICEACCOUNT_EMAIL }}
GKE_JSON: ${{ secrets.GKE_SERVICEACCOUNT_JSONKEY }}
GKE_CLUSTER_NAME: ${{ secrets.GKE_PROD_CLUSTER_NAME }}
GKE_CLUSTER_ZONE: ${{ secrets.GKE_PROD_CLUSTER_ZONE }}
GKE_CLUSTER_PROJECT: ${{ secrets.GKE_PROD_CLUSTER_PROJECT }}
LKE_SERVICEACCOUNT_TOKEN: ${{ secrets.LKE_SERVICEACCOUNT_TOKEN }}
LKE_CLUSTERID: ${{ secrets.LKE_PROD_CLUSTERID }}
jobs:
deploy-tooling-lke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup helm/kubectl env
run: |
chmod 700 .github/tools_install.sh
./.github/tools_install.sh
curl -H "Authorization: Bearer ${{ env.LKE_SERVICEACCOUNT_TOKEN }}" https://api.linode.com/v4/lke/clusters/${{ env.LKE_CLUSTERID }}/kubeconfig | jq '.kubeconfig' | sed 's/["]//g' | base64 --decode > ~/.kube/config
- name: Update ingress from dev to production
run : |
[ -a ./chart/values.yaml ] && sed -i -e 's/dev.ubivius.tk/ubivius.tk/g' ./chart/values.yaml
[ -a ./chart/cm-certificates-ss.yaml ] && sed -i -e 's/dev.ubivius.tk/ubivius.tk/g' ./chart/cm-certificates-ss.yaml
[ -a ./chart/ingressroute.yaml ] && sed -i -e 's/dev.ubivius.tk/ubivius.tk/g' ./chart/ingressroute.yaml
- name: Push with valuefile
run: |
IN=$(echo ${GITHUB_REPOSITORY})
NAME=${IN#"Ubivius/telemetry-"}
chmod 700 .github/helm_update.sh
./.github/helm_update.sh $NAME