Skip to content

Commit 70ef544

Browse files
github-actions[bot]LouisHaftmann
authored andcommitted
v4.0.2 (#92)
2 parents 82738b8 + 4f3f630 commit 70ef544

File tree

17 files changed

+531
-8
lines changed

17 files changed

+531
-8
lines changed

.github/workflows/ci-cd.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,17 @@ jobs:
8484
username: ${{ github.actor }}
8585
password: ${{ secrets.GITHUB_TOKEN }}
8686

87+
- name: Set up QEMU
88+
uses: docker/setup-qemu-action@v3
89+
90+
- name: Set up Docker Buildx
91+
uses: docker/setup-buildx-action@v3
92+
8793
- name: Build and push
88-
uses: docker/build-push-action@v5
94+
uses: docker/build-push-action@v6
8995
with:
9096
context: .
97+
platforms: linux/amd64,linux/arm64
9198
push: true
9299
tags: ${{ steps.meta.outputs.tags }}
93100
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/release.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ jobs:
3838
ref: dev
3939
fetch-depth: 0
4040

41-
- uses: actions/setup-node@v4
42-
with:
43-
node-version: lts/*
44-
4541
- name: 🛤️ Version tag must be on dev branch
4642
if: github.event_name == 'push'
4743
run: git branch --contains ${{ github.ref }} | grep dev
4844

45+
- uses: actions/setup-node@v4
46+
with:
47+
node-version: lts/*
48+
4949
- name: ⬆️ Bump version
5050
if: github.event_name == 'workflow_dispatch'
5151
id: bump-version
@@ -55,6 +55,11 @@ jobs:
5555
5656
npx bumpp ${{ env[inputs.version] }} -y -r --commit "chore(release): v%s"
5757
58+
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
59+
sed -E "s/^appVersion:.+$/appVersion: '$VERSION'/" -i install/kubernetes/github-actions-cache-server/Chart.yaml
60+
git stage install/kubernetes/github-actions-cache-server/Chart.yaml
61+
git commit --amend --no-edit
62+
5863
echo "RELEASE_REF=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
5964
6065
- name: 📥 Create release PR
@@ -112,10 +117,17 @@ jobs:
112117
username: ${{ github.actor }}
113118
password: ${{ secrets.GITHUB_TOKEN }}
114119

120+
- name: Set up QEMU
121+
uses: docker/setup-qemu-action@v3
122+
123+
- name: Set up Docker Buildx
124+
uses: docker/setup-buildx-action@v3
125+
115126
- name: Build and push
116-
uses: docker/build-push-action@v5
127+
uses: docker/build-push-action@v6
117128
with:
118129
context: .
119130
push: true
131+
platforms: linux/amd64,linux/arm64
120132
tags: ${{ steps.meta.outputs.tags }}
121133
labels: ${{ steps.meta.outputs.labels }}

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ dist/
55

66
pnpm-lock.yaml
77
data/
8-
docs/content/**/*.md
8+
docs/content/**/*.md
9+
install/

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default eslintConfig({
1919
})
2020
.append({
2121
ignores: [
22+
'install/',
2223
'.prettierrc.cjs',
2324
'.lintstagedrc.mjs',
2425
'node_modules/',
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: github-actions-cache-server
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.1
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: '4.0.1'
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "github-actions-cache-server.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "github-actions-cache-server.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "github-actions-cache-server.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ .Values.service.port }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "github-actions-cache-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20+
echo "Visit http://127.0.0.1:3000 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 3000:$CONTAINER_PORT
22+
{{- end }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "github-actions-cache-server.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "github-actions-cache-server.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "github-actions-cache-server.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "github-actions-cache-server.labels" -}}
37+
helm.sh/chart: {{ include "github-actions-cache-server.chart" . }}
38+
{{ include "github-actions-cache-server.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "github-actions-cache-server.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "github-actions-cache-server.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "github-actions-cache-server.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "github-actions-cache-server.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{{ $name := include "github-actions-cache-server.fullname" . }}
2+
{{ $internalApiBaseUrl := printf "http://%s.%s.svc.cluster.local" $name .Release.Namespace }}
3+
---
4+
apiVersion: apps/v1
5+
kind: Deployment
6+
metadata:
7+
name: {{ $name }}
8+
labels:
9+
{{- include "github-actions-cache-server.labels" . | nindent 4 }}
10+
spec:
11+
{{- if not .Values.autoscaling.enabled }}
12+
replicas: {{ .Values.replicaCount }}
13+
{{- end }}
14+
{{- with .Values.strategy }}
15+
strategy: {{ toYaml . | nindent 4 }}
16+
{{- end }}
17+
selector:
18+
matchLabels:
19+
{{- include "github-actions-cache-server.selectorLabels" . | nindent 6 }}
20+
template:
21+
metadata:
22+
{{- with .Values.podAnnotations }}
23+
annotations:
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
26+
labels:
27+
{{- include "github-actions-cache-server.labels" . | nindent 8 }}
28+
{{- with .Values.podLabels }}
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
31+
spec:
32+
{{- with .Values.imagePullSecrets }}
33+
imagePullSecrets:
34+
{{- toYaml . | nindent 8 }}
35+
{{- end }}
36+
serviceAccountName: {{ include "github-actions-cache-server.serviceAccountName" . }}
37+
securityContext:
38+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
39+
containers:
40+
- name: {{ .Chart.Name }}
41+
securityContext:
42+
{{- toYaml .Values.securityContext | nindent 12 }}
43+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
44+
imagePullPolicy: {{ .Values.image.pullPolicy }}
45+
ports:
46+
- name: http
47+
containerPort: 3000
48+
protocol: TCP
49+
livenessProbe:
50+
{{- toYaml .Values.livenessProbe | nindent 12 }}
51+
readinessProbe:
52+
{{- toYaml .Values.readinessProbe | nindent 12 }}
53+
resources:
54+
{{- toYaml .Values.resources | nindent 12 }}
55+
volumeMounts:
56+
- name: tmp
57+
mountPath: "/tmp"
58+
{{- if .Values.persistentVolumeClaim.enabled }}
59+
- name: cache-data
60+
mountPath: "/app/.data"
61+
{{- end }}
62+
env:
63+
- name: PORT
64+
value: "3000"
65+
- name: API_BASE_URL
66+
value: {{ default $internalApiBaseUrl .Values.apiBaseUrl }}
67+
{{- with .Values.env }}
68+
{{- toYaml . | nindent 12 }}
69+
{{- end }}
70+
{{- with .Values.extraEnv }}
71+
{{- toYaml . | nindent 12 }}
72+
{{- end }}
73+
volumes:
74+
- name: tmp
75+
{{- toYaml .Values.tmpVolume | nindent 10 }}
76+
{{- if .Values.persistentVolumeClaim.enabled }}
77+
- name: cache-data
78+
persistentVolumeClaim:
79+
claimName: {{ .Values.persistentVolumeClaim.template.metadata.name }}
80+
{{- end }}
81+
{{- with .Values.nodeSelector }}
82+
nodeSelector:
83+
{{- toYaml . | nindent 8 }}
84+
{{- end }}
85+
{{- with .Values.affinity }}
86+
affinity:
87+
{{- toYaml . | nindent 8 }}
88+
{{- end }}
89+
{{- with .Values.tolerations }}
90+
tolerations:
91+
{{- toYaml . | nindent 8 }}
92+
{{- end }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "github-actions-cache-server.fullname" . }}
6+
labels:
7+
{{- include "github-actions-cache-server.labels" . | nindent 4 }}
8+
spec:
9+
scaleTargetRef:
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
name: {{ include "github-actions-cache-server.fullname" . }}
13+
minReplicas: {{ .Values.autoscaling.minReplicas }}
14+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
15+
metrics:
16+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
17+
- type: Resource
18+
resource:
19+
name: cpu
20+
target:
21+
type: Utilization
22+
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
23+
{{- end }}
24+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
25+
- type: Resource
26+
resource:
27+
name: memory
28+
target:
29+
type: Utilization
30+
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
31+
{{- end }}
32+
{{- end }}

0 commit comments

Comments
 (0)