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 1173 additions and 75 deletions

View File

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

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

View File

@@ -8,7 +8,6 @@ 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,12 +1,7 @@
image:
repository: git.sebse.de/sebse/factorio-signal-exporter
tag: latest
pullPolicy: Always
initImage:
repository: git.sebse.de/sebse/factorio-signal-exporter-migrate
tag: latest
pullPolicy: Always
pullPolicy: IfNotPresent
imagePullSecrets: []