Skip to content

Commit

Permalink
Add release workflow and daphine chart
Browse files Browse the repository at this point in the history
  • Loading branch information
jordojordo committed Sep 15, 2023
1 parent af615fb commit 91d690b
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 1 deletion.
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Charts

on:
push:
branches:
- master

env:
ACTIONS_RUNNER_DEBUG: false

jobs:
release:
permissions:
actions: write
contents: write
pages: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Install Helm
uses: azure/setup-helm@v3
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
CR_SKIP_EXISTING: true
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Helm charts
# Helm charts

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

```console
helm repo add jordojordo https://jordojordo.github.io/helm-charts
```

If you had already added this repo earlier, run `helm repo update` to retrieve
the latest versions of the packages. You can then run `helm search repo
jordojordo` to see the charts.

To install the `daphine` chart:

```console
helm install daphine jordojordo/daphine
```

To uninstall the chart:

```console
helm delete daphine
```
23 changes: 23 additions & 0 deletions charts/daphine/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
7 changes: 7 additions & 0 deletions charts/daphine/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: daphine
description: An API for streaming music and videos
type: application
home: 'https://github.com/jordojordo/daphine'
version: 0.1.0
appVersion: '0.1.0'
33 changes: 33 additions & 0 deletions charts/daphine/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}
spec:
replicas: {{ .Values.deployment.replicaCount }}
selector:
matchLabels: {{ .Values.deployment.labels }}
template:
metadata:
labels: {{ .Values.deployment.labels }}
spec:
nodeName: {{ default "local-node" .Values.nodeName }}
containers:
- name: {{ .Chart.Name }}-api
image: '{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}'
ports:
- containerPort: {{ .Values.service.port }}
env:
- name: PUPPETEER_SKIP_DOWNLOAD
value: "true"
# Frontend url
- name: CORS_ORIGIN
value: {{ .Values.frontend }}
imagePullPolicy: {{ .Values.deployment.image.imagePullPolicy }}
volumeMounts:
# Mount the volume for the container
- mountPath: "./assets"
name: {{ .Values.pv.name }}
volumes:
- name: {{ .Values.pv.name }}
persistentVolumeClaim:
claimName: {{ .Values.pvc.name }}
18 changes: 18 additions & 0 deletions charts/daphine/templates/persistentvolume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ .Values.pv.name }}
labels:
type: {{ .Values.pv.type }}
spec:
capacity:
storage: {{ .Values.pv.storage }}
volumeMode: {{ .Values.pv.volumeMode }}
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: {{ .Values.storageClassName }}
hostPath:
# Path of the data within the cluster
path: {{ .Values.pv.hostPath }}
nodeAffinity: {{ .Values.pv.nodeAffinity }}
11 changes: 11 additions & 0 deletions charts/daphine/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.pvc.name }}
spec:
storageClassName: {{ .Values.storageClassName }}
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.pvc.storageRequest }}
35 changes: 35 additions & 0 deletions charts/daphine/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
frontend: 'https://example.com' # Required for CORS
nodeName: 'local-node'

deployment:
labels: { 'yokanga.xyz/api': 'daphine' }
replicaCount: 3
image:
repository: 'ghcr.io/jordojordo/daphine'
pullPolicy: 'IfNotPresent'
tag: '0.1.0'

service:
type: 'ClusterIP'
port: 3000

storageClassName: 'local-storage'

pv:
name: 'daphine-pv'
type: 'local'
storage: '2Gi'
volumeMode: 'Filesystem'
hostPath: '/mnt/assets'
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: 'kubernetes.io/hostname'
operator: In
values:
- 'local-node'

pvc:
name: 'daphine-pvc'
storageRequest: '2Gi'

0 comments on commit 91d690b

Please sign in to comment.