-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (45 loc) · 1.26 KB
/
deploy-manifests.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
name: deploy-manifests
on:
push:
branches:
- main
paths:
- 'infra/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -Ls https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Create .kube directory
run: mkdir -p $HOME/.kube
- name: Create .kube/config
run: |
cat <<EOF > $HOME/.kube/config
apiVersion: v1
kind: Config
clusters:
- name: rancher
cluster:
server: "https://rancher.riwi.dev/k8s/clusters/c-m-cp898j4l"
users:
- name: rancher
user:
token: ${{ secrets.KUBE_CONFIG_TOKEN }}
contexts:
- name: rancher
context:
user: rancher
cluster: rancher
namespace: kitapkurdu
current-context: rancher
EOF
- name: Deploy using kubectl
run: |
kubectl apply -f infra/k8s/ -n kitapkurdu
kubectl apply -f infra/secrets/ -n kitapkurdu