15 Commits

Author SHA1 Message Date
Sebastian Seedorf
8c83e8b8e8 feat: tag Docker images with semver alongside SHA and latest
All checks were successful
Build & Push / build (push) Successful in 3m48s
2026-06-02 16:15:30 +02:00
Sebastian Seedorf
399db56499 Add workflow_dispatch trigger for manual runs
Some checks failed
Build & Push / build (push) Failing after 8m47s
2026-05-19 19:10:37 +02:00
Sebastian Seedorf
3ef567a39e Pin actions to @v1 tag
Some checks failed
Build & Push / build (push) Failing after 1m48s
2026-05-19 18:42:10 +02:00
Sebastian Seedorf
1ff03cd09f Add Factorio mod push step and README
Some checks failed
Build & Push / build (push) Has been cancelled
- Add factorio-mod-push step to build.yml (mod-folder: ./plugin)
- Create plugin/README.md as bootstrap for mod portal description
2026-05-19 18:17:10 +02:00
Sebastian Seedorf
fe4ad86710 ci: use version-bump action for semver tagging
Some checks failed
Build & Push / build (push) Failing after 10m4s
2026-05-19 17:22:52 +02:00
Sebastian Seedorf
cd35b8e85e restructure: move mod files into plugin/ directory
Some checks failed
Build & Push / build (push) Failing after 1m41s
2026-05-19 13:52:27 +02:00
Caesar2011
3af0af01e0 build/patch: use build-context for docker-build-push action
All checks were successful
Build & Push / build (push) Successful in 3m53s
2026-05-18 18:41:29 +02:00
Caesar2011
456fde28a5 build/patch: update gitea action references to use https
Some checks failed
Build & Push / build (push) Failing after 1m17s
2026-05-18 18:35:29 +02:00
Caesar2011
159eb7fbc3 build/patch: update workflow to use actions from git.sebse.de
Some checks failed
Build & Push / build (push) Failing after 3s
2026-05-18 18:31:34 +02:00
Caesar2011
d5047e2f89 Refactored to external actions
Some checks failed
Build & Push / build (push) Failing after 4s
2026-05-18 18:27:58 +02:00
Caesar2011
67646c80d2 Added helm update to deployment
All checks were successful
Build & Push / build (push) Successful in 1m45s
2026-05-18 17:16:42 +02:00
Caesar2011
ee139f9518 Added app.kubernetes.io/component label to app
All checks were successful
Build & Push / build (push) Successful in 1m52s
2026-05-17 23:32:47 +02:00
Caesar2011
8f200514b1 Added migration docker image
All checks were successful
Build & Push / build (push) Successful in 3m45s
2026-05-17 23:04:15 +02:00
Caesar2011
b90038ea4c Added chart version
All checks were successful
Build & Push / build (push) Successful in 3m35s
2026-05-17 21:46:25 +02:00
Caesar2011
7f1416f94a Renamed chart to factorio-signal-exporter 2026-05-17 21:17:35 +02:00
27 changed files with 143 additions and 1211 deletions

View File

@@ -1,13 +1,13 @@
name: Build & Push
on:
workflow_dispatch:
push:
branches:
- main
env:
REGISTRY: git.sebse.de
IMAGE: git.sebse.de/sebse/factorio-signal-exporter
CHART_PATH: web/charts/factorio-signal-exporter
jobs:
build:
@@ -17,14 +17,24 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
- name: Bump version
id: version
uses: https://git.sebse.de/sebse/actions/version-bump@v1
with:
token: ${{ github.token }}
- name: Set env vars
run: |
echo "IMAGE=git.sebse.de/${{ github.repository }}" >> $GITHUB_ENV
echo "IMAGE_MIGRATE=git.sebse.de/${{ github.repository }}-migrate" >> $GITHUB_ENV
- name: Docker login
uses: https://git.sebse.de/sebse/actions/docker-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata
- name: Extract metadata (app)
id: meta
uses: docker/metadata-action@v5
with:
@@ -32,24 +42,57 @@ jobs:
tags: |
type=sha,prefix=,format=short
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
- name: Build and push
- name: Build and push app
uses: docker/build-push-action@v5
with:
context: ./web
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE }}:latest
cache-to: type=inline
- name: Package Helm chart
run: helm package web/charts/factorio-dashboard
- name: Extract metadata (migrate)
id: meta-migrate
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_MIGRATE }}
tags: |
type=sha,prefix=,format=short
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
- name: Push Helm chart to Gitea
run: |
curl -u ${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_TOKEN }} \
-X POST \
https://${{ env.REGISTRY }}/api/packages/sebse/helm/api/charts \
-F "chart=@factorio-dashboard-0.1.0.tgz" \
--fail-with-body
- name: Build and push migrate
uses: docker/build-push-action@v5
with:
context: ./web
file: ./web/Dockerfile.migrate
push: true
tags: ${{ steps.meta-migrate.outputs.tags }}
cache-from: type=registry,ref=${{ env.IMAGE_MIGRATE }}:latest
cache-to: type=inline
- name: Package and push helm chart
uses: https://git.sebse.de/sebse/actions/helm-package-push@v1
with:
chart-path: ${{ env.CHART_PATH }}
version: ${{ steps.version.outputs.version }}
app-version: ${{ steps.version.outputs.version }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Package and push Factorio mod
uses: https://git.sebse.de/sebse/actions/factorio-mod-push@v1
with:
mod-folder: ./plugin
version: ${{ steps.version.outputs.version }}
factorio-token: ${{ secrets.FACTORIO_TOKEN }}
- name: Deploy to prod
uses: https://git.sebse.de/sebse/actions/helm-deploy@v1
with:
app: factorio-signal-exporter
profile: prod
version: ${{ steps.version.outputs.version }}
ssh-key: ${{ secrets.HELMBOT_SSH_KEY }}

File diff suppressed because it is too large Load Diff

3
plugin/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Signal Exporter
Provides a custom combinator that reads both connected circuit and logistic networks, writing the data to a JSON file.

10
web/Dockerfile.migrate Normal file
View File

@@ -0,0 +1,10 @@
FROM node:24-alpine
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
COPY migrations/ ./migrations/
CMD ["npm", "run", "migrate"]

View File

@@ -1,12 +0,0 @@
{{- if not .Values.app.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "factorio-dashboard.fullname" . }}-secret
labels:
{{- include "factorio-dashboard.labels" . | nindent 4 }}
type: Opaque
stringData:
API_TOKEN: {{ .Values.app.apiToken | required "app.apiToken is required" | quote }}
DATABASE_URL: {{ include "factorio-dashboard.databaseUrl" . | quote }}
{{- end }}

View File

@@ -1,13 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "factorio-dashboard.fullname" . }}
labels:
{{- include "factorio-dashboard.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
{{- include "factorio-dashboard.selectorLabels" . | nindent 4 }}
ports:
- port: {{ .Values.service.port }}
targetPort: 3000

View File

@@ -1,6 +1,6 @@
apiVersion: v2
name: factorio-dashboard
name: factorio-signal-exporter
description: Factorio Signal Exporter — Next.js dashboard with TimescaleDB
type: application
version: 0.1.0
version: 0.0.0-dev
appVersion: "latest"

View File

@@ -1,23 +1,23 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "factorio-dashboard.name" -}}
{{- define "factorio-signal-exporter.name" -}}
{{- .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a fully qualified app name.
*/}}
{{- define "factorio-dashboard.fullname" -}}
{{- printf "%s" (include "factorio-dashboard.name" .) | trunc 63 | trimSuffix "-" }}
{{- define "factorio-signal-exporter.fullname" -}}
{{- printf "%s" (include "factorio-signal-exporter.name" .) | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels.
*/}}
{{- define "factorio-dashboard.labels" -}}
{{- define "factorio-signal-exporter.labels" -}}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
app.kubernetes.io/name: {{ include "factorio-dashboard.name" . }}
app.kubernetes.io/name: {{ include "factorio-signal-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
@@ -26,25 +26,25 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels.
*/}}
{{- define "factorio-dashboard.selectorLabels" -}}
app.kubernetes.io/name: {{ include "factorio-dashboard.name" . }}
{{- define "factorio-signal-exporter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "factorio-signal-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Name of the secret that holds API_TOKEN and DATABASE_URL.
*/}}
{{- define "factorio-dashboard.secretName" -}}
{{- define "factorio-signal-exporter.secretName" -}}
{{- if .Values.app.existingSecret }}
{{- .Values.app.existingSecret }}
{{- else }}
{{- include "factorio-dashboard.fullname" . }}-secret
{{- include "factorio-signal-exporter.fullname" . }}-secret
{{- end }}
{{- end }}
{{/*
Construct DATABASE_URL from db values.
*/}}
{{- define "factorio-dashboard.databaseUrl" -}}
{{- printf "postgresql://%s:%s@%s-db:%d/%s" .Values.db.user .Values.db.password (include "factorio-dashboard.fullname" .) (int .Values.db.port) .Values.db.name }}
{{- define "factorio-signal-exporter.databaseUrl" -}}
{{- printf "postgresql://%s:%s@%s-db:%d/%s" .Values.db.user .Values.db.password (include "factorio-signal-exporter.fullname" .) (int .Values.db.port) .Values.db.name }}
{{- end }}

View File

@@ -1,14 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "factorio-dashboard.fullname" . }}-db
name: {{ include "factorio-signal-exporter.fullname" . }}-db
labels:
{{- include "factorio-dashboard.labels" . | nindent 4 }}
{{- include "factorio-signal-exporter.labels" . | nindent 4 }}
app.kubernetes.io/component: db
spec:
clusterIP: None
selector:
{{- include "factorio-dashboard.selectorLabels" . | nindent 4 }}
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: db
ports:
- port: {{ .Values.db.port }}

View File

@@ -1,21 +1,21 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "factorio-dashboard.fullname" . }}-db
name: {{ include "factorio-signal-exporter.fullname" . }}-db
labels:
{{- include "factorio-dashboard.labels" . | nindent 4 }}
{{- include "factorio-signal-exporter.labels" . | nindent 4 }}
app.kubernetes.io/component: db
spec:
serviceName: {{ include "factorio-dashboard.fullname" . }}-db
serviceName: {{ include "factorio-signal-exporter.fullname" . }}-db
replicas: 1
selector:
matchLabels:
{{- include "factorio-dashboard.selectorLabels" . | nindent 6 }}
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: db
template:
metadata:
labels:
{{- include "factorio-dashboard.selectorLabels" . | nindent 8 }}
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: db
spec:
containers:
@@ -26,12 +26,6 @@ spec:
env:
- name: POSTGRES_USER
value: {{ .Values.db.user | quote }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "factorio-dashboard.secretName" . }}
key: DATABASE_URL
optional: false
- name: POSTGRES_PASSWORD
value: {{ .Values.db.password | quote }}
- name: POSTGRES_DB

View File

@@ -1,18 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "factorio-dashboard.fullname" . }}
name: {{ include "factorio-signal-exporter.fullname" . }}
labels:
{{- include "factorio-dashboard.labels" . | nindent 4 }}
{{- include "factorio-signal-exporter.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.app.replicaCount }}
selector:
matchLabels:
{{- include "factorio-dashboard.selectorLabels" . | nindent 6 }}
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: app
template:
metadata:
labels:
{{- include "factorio-dashboard.selectorLabels" . | nindent 8 }}
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: app
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
@@ -20,14 +23,13 @@ spec:
{{- end }}
initContainers:
- name: migrate
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["npm", "run", "migrate"]
image: {{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}
imagePullPolicy: {{ .Values.initImage.pullPolicy }}
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ include "factorio-dashboard.secretName" . }}
name: {{ include "factorio-signal-exporter.secretName" . }}
key: DATABASE_URL
containers:
- name: app
@@ -39,12 +41,12 @@ spec:
- name: API_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "factorio-dashboard.secretName" . }}
name: {{ include "factorio-signal-exporter.secretName" . }}
key: API_TOKEN
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ include "factorio-dashboard.secretName" . }}
name: {{ include "factorio-signal-exporter.secretName" . }}
key: DATABASE_URL
readinessProbe:
httpGet:

View File

@@ -2,9 +2,9 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "factorio-dashboard.fullname" . }}
name: {{ include "factorio-signal-exporter.fullname" . }}
labels:
{{- include "factorio-dashboard.labels" . | nindent 4 }}
{{- include "factorio-signal-exporter.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
@@ -17,7 +17,7 @@ spec:
tls:
- hosts:
- {{ .Values.ingress.host | quote }}
secretName: {{ .Values.ingress.tlsSecretName | default (printf "%s-tls" (include "factorio-dashboard.fullname" .)) | quote }}
secretName: {{ .Values.ingress.tlsSecretName | default (printf "%s-tls" (include "factorio-signal-exporter.fullname" .)) | quote }}
{{- end }}
rules:
- host: {{ .Values.ingress.host | quote }}
@@ -27,7 +27,7 @@ spec:
pathType: Prefix
backend:
service:
name: {{ include "factorio-dashboard.fullname" . }}
name: {{ include "factorio-signal-exporter.fullname" . }}
port:
number: {{ .Values.service.port }}
{{- end }}

View File

@@ -0,0 +1,12 @@
{{- if not .Values.app.existingSecret }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "factorio-signal-exporter.fullname" . }}-secret
labels:
{{- include "factorio-signal-exporter.labels" . | nindent 4 }}
type: Opaque
stringData:
API_TOKEN: {{ .Values.app.apiToken | required "app.apiToken is required" | quote }}
DATABASE_URL: {{ include "factorio-signal-exporter.databaseUrl" . | quote }}
{{- end }}

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "factorio-signal-exporter.fullname" . }}
labels:
{{- include "factorio-signal-exporter.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
selector:
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: app
ports:
- port: {{ .Values.service.port }}
targetPort: 3000

View File

@@ -1,7 +1,12 @@
image:
repository: git.sebse.de/sebse/factorio-signal-exporter
tag: latest
pullPolicy: IfNotPresent
pullPolicy: Always
initImage:
repository: git.sebse.de/sebse/factorio-signal-exporter-migrate
tag: latest
pullPolicy: Always
imagePullSecrets: []
@@ -20,7 +25,7 @@ db:
name: factorio
port: 5432
storage: 10Gi
storageClassName: "" # leave empty for cluster default
storageClassName: ""
service:
type: ClusterIP