-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (113 loc) · 5.14 KB
/
Copy pathci.yml
File metadata and controls
132 lines (113 loc) · 5.14 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint manifests + helm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install kubeconform + helm
run: |
curl -sSL -o /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz
tar -xzf /tmp/kubeconform.tar.gz -C /tmp/
chmod +x /tmp/kubeconform && sudo mv /tmp/kubeconform /usr/local/bin/kubeconform
curl -fsSL -o /tmp/helm.tar.gz https://get.helm.sh/helm-v3.15.0-linux-amd64.tar.gz
tar -xzf /tmp/helm.tar.gz -C /tmp/
chmod +x /tmp/linux-amd64/helm && sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
- name: Validate raw manifests
run: find manifests/ -name '*.yaml' -print0 | xargs -0 kubeconform -strict -summary
- name: Lint helm chart
run: helm lint helm/buyerchat
- name: Template helm + validate
run: helm template helm/buyerchat | kubeconform -strict -summary -ignore-missing-schemas
smoke:
name: Smoke (helm render + validate)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install kubeconform + helm
run: |
curl -sSL -o /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz
tar -xzf /tmp/kubeconform.tar.gz -C /tmp/
chmod +x /tmp/kubeconform && sudo mv /tmp/kubeconform /usr/local/bin/kubeconform
curl -fsSL -o /tmp/helm.tar.gz https://get.helm.sh/helm-v3.15.0-linux-amd64.tar.gz
tar -xzf /tmp/helm.tar.gz -C /tmp/
chmod +x /tmp/linux-amd64/helm && sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
- name: Helm lint all charts
run: |
for chart in helm/*; do
[ -d "$chart" ] && helm lint "$chart"
done
- name: Render helm templates and validate
run: |
for chart in helm/*; do
[ -d "$chart" ] && helm template "$chart" | kubeconform -strict -summary -ignore-missing-schemas
done
- name: Validate raw manifests
run: find manifests/ -name '*.yaml' -print0 | xargs -0 kubeconform -strict -summary -ignore-missing-schemas
gitops:
name: GitOps (rollout + app-of-apps render)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install kubeconform + helm
run: |
curl -sSL -o /tmp/kubeconform.tar.gz https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz
tar -xzf /tmp/kubeconform.tar.gz -C /tmp/
chmod +x /tmp/kubeconform && sudo mv /tmp/kubeconform /usr/local/bin/kubeconform
curl -fsSL -o /tmp/helm.tar.gz https://get.helm.sh/helm-v3.15.0-linux-amd64.tar.gz
tar -xzf /tmp/helm.tar.gz -C /tmp/
chmod +x /tmp/linux-amd64/helm && sudo mv /tmp/linux-amd64/helm /usr/local/bin/helm
- name: Lint + render infra wrapper charts (argo-rollouts, argocd)
# These pin the upstream chart via Chart.yaml dependencies; build
# the dependency before lint/template. -ignore-missing-schemas
# because the upstream charts ship CRDs (Rollout, Application).
run: |
# Both wrapper charts pin upstream charts from the argo-helm repo;
# register it so `helm dependency build` can resolve them.
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
for chart in infra/argo-rollouts infra/argocd; do
helm dependency build "$chart"
helm lint "$chart"
helm template "$chart" | kubeconform -strict -summary -ignore-missing-schemas
done
- name: Render rollout-enabled buyerchat + validate
# values.dev.yaml sets rollout.enabled=true, so this renders the
# Argo Rollout + AnalysisTemplate path (CRD-typed → needs
# -ignore-missing-schemas).
run: helm template helm/buyerchat -f helm/buyerchat/values.dev.yaml | kubeconform -strict -summary -ignore-missing-schemas
- name: Validate app-of-apps manifests
run: kubeconform -strict -summary -ignore-missing-schemas argocd/root-app.yaml argocd/apps/*.yaml
build-docs:
name: Build docs site
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: docs-site/package-lock.json
- name: Build static site
working-directory: docs-site
run: |
npm ci
npm run build
# Build runs on every push/PR (validates the site). Deploy to gh-pages
# only on push to the default branch — PRs build but don't publish.
- uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs-site/out