1 Commits

Author SHA1 Message Date
Caesar2011
94dbbc7743 Added chart version
Some checks failed
Build & Push / build (push) Failing after 44s
2026-05-17 21:39:10 +02:00
19 changed files with 1157 additions and 86 deletions

View File

@@ -1,13 +1,13 @@
name: Build & Push name: Build & Push
on: on:
workflow_dispatch:
push: push:
branches: branches:
- main - main
env: env:
CHART_PATH: web/charts/factorio-signal-exporter REGISTRY: git.sebse.de
IMAGE: git.sebse.de/sebse/factorio-signal-exporter
jobs: jobs:
build: build:
@@ -17,24 +17,17 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Bump version - name: Install Helm
id: version uses: azure/setup-helm@v4
uses: https://git.sebse.de/sebse/actions/version-bump@v1
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with: with:
token: ${{ github.token }} registry: ${{ env.REGISTRY }}
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Set env vars - name: Extract metadata
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:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Extract metadata (app)
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
@@ -42,57 +35,29 @@ jobs:
tags: | tags: |
type=sha,prefix=,format=short type=sha,prefix=,format=short
type=raw,value=latest type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
- name: Build and push app - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: ./web context: ./web
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ env.IMAGE }}:latest cache-from: type=registry,ref=${{ env.IMAGE }}:latest
cache-to: type=inline cache-to: type=inline
- name: Extract metadata (migrate) - name: Package Helm chart
id: meta-migrate run: |
uses: docker/metadata-action@v5 SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
with: helm package web/charts/factorio-signal-exporter \
images: ${{ env.IMAGE_MIGRATE }} --version "0.0.0-${SHORT_SHA}" \
tags: | --app-version "${SHORT_SHA}"
type=sha,prefix=,format=short
type=raw,value=latest
type=raw,value=${{ steps.version.outputs.version }}
- name: Build and push migrate - name: Push Helm chart to Gitea
uses: docker/build-push-action@v5 run: |
with: SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
context: ./web curl -u ${{ secrets.GITEA_USERNAME }}:${{ secrets.GITEA_TOKEN }} \
file: ./web/Dockerfile.migrate -X POST \
push: true https://${{ env.REGISTRY }}/api/packages/sebse/helm/api/charts \
tags: ${{ steps.meta-migrate.outputs.tags }} -F "chart=@factorio-signal-exporter-0.0.0-${SHORT_SHA}.tgz" \
cache-from: type=registry,ref=${{ env.IMAGE_MIGRATE }}:latest --fail-with-body
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

View File

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

View File

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

View File

@@ -9,12 +9,10 @@ spec:
selector: selector:
matchLabels: matchLabels:
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 6 }} {{- include "factorio-signal-exporter.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: app
template: template:
metadata: metadata:
labels: labels:
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 8 }} {{- include "factorio-signal-exporter.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: app
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
spec: spec:
{{- with .Values.imagePullSecrets }} {{- with .Values.imagePullSecrets }}
@@ -23,8 +21,9 @@ spec:
{{- end }} {{- end }}
initContainers: initContainers:
- name: migrate - name: migrate
image: {{ .Values.initImage.repository }}:{{ .Values.initImage.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: {{ .Values.initImage.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["npm", "run", "migrate"]
env: env:
- name: DATABASE_URL - name: DATABASE_URL
valueFrom: valueFrom:

View File

@@ -8,7 +8,6 @@ spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
selector: selector:
{{- include "factorio-signal-exporter.selectorLabels" . | nindent 4 }} {{- include "factorio-signal-exporter.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: app
ports: ports:
- port: {{ .Values.service.port }} - port: {{ .Values.service.port }}
targetPort: 3000 targetPort: 3000

View File

@@ -1,12 +1,7 @@
image: image:
repository: git.sebse.de/sebse/factorio-signal-exporter repository: git.sebse.de/sebse/factorio-signal-exporter
tag: latest tag: latest
pullPolicy: Always pullPolicy: IfNotPresent
initImage:
repository: git.sebse.de/sebse/factorio-signal-exporter-migrate
tag: latest
pullPolicy: Always
imagePullSecrets: [] imagePullSecrets: []