Author SHA1 Message Date
dutchie031 898866c773 updated priviliged folders 2026-07-30 13:40:04 +02:00
dutchie031 3b4215ef62 removed unnecesarry kubectl installation 2026-07-30 13:20:30 +02:00
dutchie031 cc327f60c8 updated ingress 2026-07-30 12:41:33 +02:00
dutchie031 7e9a697bb2 updated ingress 2026-07-30 12:14:31 +02:00
dutchie031 2ac5d6579d updated ingress 2026-07-30 12:12:21 +02:00
dutchie031 234ae789c3 updated ingress 2026-07-30 12:10:12 +02:00
dutchie031 24b6bae55a updated helm and deployment 2026-07-30 11:58:10 +02:00
dutchie031 c914ec5415 updated helm and deployment 2026-07-30 11:57:30 +02:00
dutchie031 a5360130c2 updated helm and deployment 2026-07-30 11:40:05 +02:00
dutchie031 41d1c47563 updated helm and deployment 2026-07-30 11:35:35 +02:00
dutchie031 ccf6caa034 updated helm and deployment 2026-07-30 11:32:45 +02:00
dutchie031 e8a96d75df updated helm and deployment 2026-07-30 11:31:11 +02:00
dutchie031 95ddc7ca05 updated helm and deployment 2026-07-30 11:24:28 +02:00
dutchie031 d86d62d69a updated helm and deployment 2026-07-30 11:12:24 +02:00
dutchie031 9a885e8b83 updated helm and deployment 2026-07-30 11:11:55 +02:00
dutchie031 da243f5c3f updated helm and deployment 2026-07-30 11:08:59 +02:00
dutchie031 fc3e8debf3 updated helm and deployment 2026-07-30 11:05:37 +02:00
dutchie031 a3348f4bd4 updated helm and deployment 2026-07-30 11:04:40 +02:00
dutchie031 de8881b239 wip 2026-07-27 20:01:24 +02:00
dutchie031 8fbcb15c98 wip 2026-07-27 19:58:18 +02:00
dutchie031 c3a05096f4 wip 2026-07-27 19:51:12 +02:00
dutchie031 e96c5dfaf8 wip 2026-07-27 19:48:47 +02:00
dutchie031 9adc2f63b9 wip 2026-07-27 19:47:19 +02:00
dutchie031 c1a832a01e wip 2026-07-27 19:44:54 +02:00
dutchie031 8c972483af wip 2026-07-27 19:43:01 +02:00
dutchie031 545944fa9b wip 2026-07-27 19:40:01 +02:00
dutchie031 db7a3173f3 wip 2026-07-27 19:34:38 +02:00
dutchie031 47722c7f5a wip 2026-07-27 19:25:40 +02:00
dutchie031 f33bf869eb Python package installation 2026-07-27 19:03:07 +02:00
dutchie031 b4865a9913 Python package installation 2026-07-27 18:56:40 +02:00
dutchie031 936d518f47 Python package installation 2026-07-27 18:53:17 +02:00
dutchie031 a6f882a371 Python package installation 2026-07-27 18:51:39 +02:00
dutchie031 5b8a1426d1 docker build 2026-07-27 17:16:37 +02:00
dutchie031 ffc25a5f99 docker build 2026-07-27 17:16:37 +02:00
5 changed files with 191 additions and 5 deletions
+88 -4
View File
@@ -5,7 +5,12 @@ on:
branches: branches:
- main - main
paths: paths:
- '_docs/**' - '.docs/**'
env:
DOCKER_REGISTRY: registry.dutchie031.net
DOCKER_IMAGE: spearhead-docs
DOCKER_TAG: latest
jobs: jobs:
## Run replacements and cleanups on the docs ## Run replacements and cleanups on the docs
@@ -17,16 +22,45 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
## --break-system-packages is used to avoid conflicts with system-installed packages on Ubuntu runners.
- name: Install Python Pygments
run: |
python3 -m pip install --upgrade pip --break-system-packages --no-cache-dir --ignore-installed
pip install pygments --break-system-packages
- name: Highlight API code and update HTML
run: |
pygmentize -f html -l lua -O noclasses,style=monokai src/classes/api/SpearheadApiDoc.lua > .docs/web/pages/temp_api_code.html
# Insert the highlighted code into the placeholder in spearheadapi.html
sed -i '/@@API_CODE@@/r .docs/web/pages/temp_api_code.html' .docs/web/pages/spearheadapi.html
sed -i '/@@API_CODE@@/d' .docs/web/pages/spearheadapi.html
rm .docs/web/pages/temp_api_code.html
- name: Highlight API code and update HTML
run: |
pygmentize -f html -l lua -O noclasses,style=monokai ./config.lua > .docs/web/pages/temp_config_code.html
# Insert the highlighted code into the placeholder in spearheadapi.html
sed -i '/@@CONFIG_CODE@@/r .docs/web/pages/temp_config_code.html' .docs/web/pages/reference.html
sed -i '/@@CONFIG_CODE@@/d' .docs/web/pages/reference.html
rm .docs/web/pages/temp_config_code.html
- name: List files in .docs directory
run: |
echo "Listing files in .docs directory:"
ls -R .docs
- name: Upload spearhead.lua artifact - name: Upload spearhead.lua artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: spearhead-docs name: spearhead-docs
path: ./.docs/**/* path: |
./.docs/Dockerfile
./.docs/web/**/*
retention-days: 1 retention-days: 1
build-image: build-image:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: prepare-docs
steps: steps:
# Download prepared pages from the previous job # Download prepared pages from the previous job
@@ -34,11 +68,61 @@ jobs:
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: spearhead-docs name: spearhead-docs
path: ./spearhead-docs
- name: DEBUG ls
run: |
ls -R ./spearhead-docs
- name: Build Docker image for docs - name: Build Docker image for docs
run: | run: |
docker build -t spearhead-docs ./_docs docker build -t ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} ./spearhead-docs
- name: Push Docker image
run: |
docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}
deploy-container:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Helm
uses: azure/setup-helm@v5
with:
version: 'latest'
id: install
- name: Set up Kubeconfig
run: |
mkdir -p $HOME/.kube
echo "${{ secrets.KUBECONFIG_CONTENT }}" > $HOME/.kube/config
chmod 600 $HOME/.kube/config
cat $HOME/.kube/config
- name: Run Helm upgrade/install
run: |
helm upgrade --install spearhead-docs .helm \
--namespace spearhead-docs \
--create-namespace \
--set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \
--set image.tag=${{ env.DOCKER_TAG }} \
--wait
# - name: 'Deploy'
# uses: deliverybot/helm@v1
# with:
# release: spearhead-docs
# namespace: spearhead-docs
# chart: '.helm'
# value-files: >-
# [
# ".helm/values.yaml"
# ]
# env:
# KUBECONFIG_FILE: ${{ secrets.KUBECONFIG_CONTENT }}
+44
View File
@@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.app }}
labels:
app: {{ .Values.app }}
namespace: spearhead-docs
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Values.app }}
template:
metadata:
labels:
app: {{ .Values.app }}
spec:
securityContext:
runAsNonRoot: true
runAsUser: 65534
seccompProfile:
type: RuntimeDefault
containers:
- name: {{ .Values.app }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
ports:
- containerPort: {{ .Values.ports.containerPort }}
volumeMounts:
- name: cache
mountPath: /var/cache/nginx
- name: run
mountPath: /var/run
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumes:
- name: cache
emptyDir: {}
- name: run
emptyDir: {}
View File
+48
View File
@@ -0,0 +1,48 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app }}
namespace: spearhead-docs
spec:
selector:
app.kubernetes.io/name: {{ .Values.app }}
ports:
- protocol: TCP
port: {{ .Values.ports.servicePort }}
targetPort: {{ .Values.ports.containerPort }}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Values.app }}-ingress
namespace: spearhead-docs
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
ingressClassName: nginx
rules:
- host: spearhead.dutchie031.net
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Values.app }}
port:
number: {{ .Values.ports.servicePort }}
# - host: spearhead.rocks
# http:
# paths:
# - path: /
# pathType: Prefix
# backend:
# service:
# name: {{ .Values.app }}
# port:
# number: {{ .Values.ports.servicePort }}
tls:
- hosts:
- spearhead.dutchie031.net
#- spearhead.rocks
secretName: spearhead-docs-tls
+10
View File
@@ -0,0 +1,10 @@
app: spearhead-docs
image:
repository: registry.dutchie031.net/spearhead-docs
tag: latest
ports:
servicePort: 80
containerPort: 80