Skip to content

Commit d41bf52

Browse files
committed
add deploy to kubernetes stuff
1 parent a8a86b3 commit d41bf52

File tree

4 files changed

+140
-39
lines changed

4 files changed

+140
-39
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -84,42 +84,42 @@ jobs:
8484
run: |
8585
/apps/clean_stale_releases.sh torus-docs
8686
87-
# deploy:
88-
# needs: [build, clean-stale]
89-
# runs-on: ubicloud-standard-2
90-
# environment: ${{ github.ref_name }}
91-
# container:
92-
# image: ghcr.io/renlabs-dev/devops-ci:latest
93-
94-
# env:
95-
# VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
96-
# VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
97-
# VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}
98-
99-
# steps:
100-
# - name: Checkout repository
101-
# uses: actions/checkout@v4
102-
103-
# - name: Setup Kubernetes authentication
104-
# run: /apps/k8s_auth_w_approle_sa.sh
105-
106-
# - name: Add and update Helm repositories
107-
# run: |
108-
# helm repo add renlabs https://charts.renlabs.dev/
109-
# helm repo update
110-
111-
# - id: commit
112-
# uses: prompt/actions-commit-hash@v3
113-
114-
# - name: Set environment variables
115-
# run: |
116-
# SANITIZED_REF=$(echo "${GITHUB_REF##*/}" | tr '/' '-')
117-
# echo "SANITIZED_REF=$SANITIZED_REF" >> $GITHUB_ENV
118-
# echo "INGRESS=$([ "$SANITIZED_REF" == "main" ] && echo "docs.torus.network" || echo "$SANITIZED_REF.docs.torus.network")" >> $GITHUB_ENV
119-
120-
# - name: Deploy application
121-
# run: |
122-
# helmfile sync \
123-
# --state-values-set releaseName=${{ env.SANITIZED_REF }}-torus-docs \
124-
# --state-values-set ingressHost=${{ env.INGRESS }} \
125-
# --set deployment.image.tag=${{ steps.commit.outputs.short }}
87+
deploy:
88+
needs: [build, clean-stale]
89+
runs-on: ubicloud-standard-2
90+
environment: ${{ github.ref_name }}
91+
container:
92+
image: ghcr.io/renlabs-dev/devops-ci:latest
93+
94+
env:
95+
VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
96+
VAULT_ROLE_ID: ${{ secrets.VAULT_ROLE_ID }}
97+
VAULT_SECRET_ID: ${{ secrets.VAULT_SECRET_ID }}
98+
99+
steps:
100+
- name: Checkout repository
101+
uses: actions/checkout@v4
102+
103+
- name: Setup Kubernetes authentication
104+
run: /apps/k8s_auth_w_approle_sa.sh
105+
106+
- name: Add and update Helm repositories
107+
run: |
108+
helm repo add renlabs https://charts.renlabs.dev/
109+
helm repo update
110+
111+
- id: commit
112+
uses: prompt/actions-commit-hash@v3
113+
114+
- name: Set environment variables
115+
run: |
116+
SANITIZED_REF=$(echo "${GITHUB_REF##*/}" | tr '/' '-')
117+
echo "SANITIZED_REF=$SANITIZED_REF" >> $GITHUB_ENV
118+
echo "INGRESS=$([ "$SANITIZED_REF" == "main" ] && echo "docs.torus.network" || echo "$SANITIZED_REF.docs.torus.network")" >> $GITHUB_ENV
119+
120+
- name: Deploy application
121+
run: |
122+
helmfile sync \
123+
--state-values-set releaseName=${{ env.SANITIZED_REF }}-torus-docs \
124+
--state-values-set ingressHost=${{ env.INGRESS }} \
125+
--set deployment.image.tag=${{ steps.commit.outputs.short }}

helm/values.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
deployment:
2+
image:
3+
repository: ghcr.io/renlabs-dev/torus-docs
4+
5+
additionalLabels:
6+
app: torus-docs
7+
version: "{{ .Values.docsVersion }}"
8+
9+
podLabels:
10+
app: torus-docs
11+
version: "{{ .Values.docsVersion }}"
12+
13+
14+
reloadOnChange: true
15+
16+
startupProbe:
17+
enabled: true
18+
failureThreshold: 30
19+
periodSeconds: 10
20+
httpGet:
21+
path: /
22+
port: 80
23+
24+
readinessProbe:
25+
enabled: true
26+
failureThreshold: 3
27+
periodSeconds: 10
28+
successThreshold: 1
29+
timeoutSeconds: 1
30+
initialDelaySeconds: 10
31+
httpGet:
32+
path: /
33+
port: 80
34+
35+
livenessProbe:
36+
enabled: true
37+
failureThreshold: 3
38+
periodSeconds: 10
39+
successThreshold: 1
40+
timeoutSeconds: 1
41+
initialDelaySeconds: 10
42+
httpGet:
43+
path: /
44+
port: 80
45+
46+
# resources:
47+
# limits:
48+
# memory: 256Mi
49+
# cpu: 0.5
50+
# requests:
51+
# memory: 128Mi
52+
# cpu: 0.1
53+
54+
containerSecurityContext:
55+
runAsNonRoot: false
56+
57+
# command: []
58+
59+
# args: []
60+
61+
ports:
62+
- containerPort: 80
63+
name: http
64+
protocol: TCP
65+
66+
service:
67+
ports:
68+
- port: 80
69+
name: http
70+
protocol: TCP
71+
targetPort: 80
72+
73+
ingress:
74+
enabled: true
75+
ingressClassName: nginx

helm/values.yaml.gotmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ .Values | toYaml }}

helmfile.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
environments:
2+
default:
3+
values:
4+
- helm/values.yaml
5+
---
6+
helmDefaults:
7+
wait: true
8+
createNamespace: false
9+
10+
repositories:
11+
- name: renlabs
12+
url: https://charts.renlabs.dev/
13+
14+
releases:
15+
- name: "{{ .Values.releaseName }}"
16+
namespace: torus-docs
17+
chart: renlabs/application
18+
values:
19+
- helm/values.yaml.gotmpl
20+
- ingress:
21+
hosts:
22+
- host: "{{ .Values.ingressHost }}"
23+
paths:
24+
- path: /
25+
pathType: Prefix

0 commit comments

Comments
 (0)