Feature/automation #6

Merged
dutchie031 merged 39 commits from feature/automation into main 2026-07-30 12:26:55 +00:00
19 changed files with 671 additions and 498 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

+6 -11
View File
@@ -35,14 +35,12 @@
<h1 id="welcome">Welcome to Spearhead!</h1>
<p>Welcome to the story teller friendly mission framework in DCS (at least, that's what we hope to create).</p>
<p>Together with mission editors we've tried to build a framework that makes creating multiplayer missions as easy as possible.
With the help of naming conventions, trigger zones, pre-configured logic and custom configuration items, it gives a huge amount of versatility.
we're trying to strike a balance between no-code and low-code with the possibility to hook into it for the hard core scripters (like ourselves).
<note-box type="info">
<b>For the scripters</b>: If you yourself are a scripter, and you're missing interfaces, please reach out to us! We want to make sure that the framework is as easy to use for scripters as it is for non-scripters, and we can't do that without your help!
</note-box>
<p>Together with mission editors we've tried to build a framework that
makes creating multiplayer missions as easy as possible.
With the help of naming conventions, trigger zones, pre-configured
logic and custom configuration items, it gives a huge amount of versatility.
we're trying to strike a balance between no-code and low-code with the possibility to hook into it for
the hard core scripters.
</p>
<p>
Whether this is your first mission or your hundredth, we hope Spearhead will make your life easier.
@@ -50,10 +48,7 @@
<download-spearhead></download-spearhead>
</div>
</div>
</main>
<footer>
@@ -38,7 +38,7 @@ class DownloadScript extends HTMLElement {
}
try {
const response = await fetch('https://api.github.com/repos/dutchie031/Spearhead/releases/latest');
const response = await fetch('https://git.dutchie031.com/api/v1/repos/Spearhead/spearhead/releases/latest');
const data = await response.json();
// Cache the data
@@ -66,7 +66,7 @@ class DownloadScript extends HTMLElement {
var version = "?";
var timestamp = "?";
var size = "?";
var href = "https://github.com/dutchie031/Spearhead/releases"
var href = "https://git.dutchie031.com/Spearhead/spearhead/releases"
const latestRelease = await this.fetchLatestRelease();
if (latestRelease) {
@@ -105,7 +105,7 @@ class DownloadScript extends HTMLElement {
<p>
<span class="version-text">${version}</span> (${timestamp}) <br>
<a style="text-decoration: underline;" target="_blank" href="${href}">Download</a> (${size}) <br>
<a style="text-decoration: underline;" target="_blank" href="https://github.com/dutchie031/Spearhead/releases">See All Versions here</a>
<a style="text-decoration: underline;" target="_blank" href="https://git.dutchie031.com/Spearhead/spearhead/releases">See All Versions here</a>
</p>
</div>
+3 -1
View File
@@ -37,9 +37,11 @@
Even though, at the time of writing this, I've written every single line of code myself, I could not have done it without the help of these members.<br>
Therefore it's something WE created.
Our goal was very simple, make it possible to make big dynamic missions, without having to either give away all control or having to get knee deep into scripting. <br>
Our goal was very simple, make it possible to make big dynamic missions, without having to either give away all controll or having to get knee deep into scripting. <br>
We struck a balance.
</p>
<h2>Hope you enjoy it!</h2>
+2 -2
View File
@@ -90,13 +90,13 @@
Missions are also defined by trigger zones. <br>
They'll be picked up by Spearhead when named according to the naming convention: <br>
<code-inline>MISSION_[Type]_[FreeForm]</code-inline> <br>
Where <code-inline>[Type]</code-inline> is the type of mission. <a href="./reference.html#mission-zones">See all</a><br>
Where <code-inline>[Type]</code-inline> is the type of mission. <br>
</p>
<h3 id="mission-cas">CAS</h3>
<p>
Personally CAS is one of my favorite mission types. <br>
Personally CAS is one of our favorite mission types. <br>
Mostly because it's easy to set up and creates a truly immersive experience. <br>
</p>
+1 -12
View File
@@ -80,22 +80,11 @@
<strong>Example:</strong> <code-inline>MISSION_DEAD_BYRON</code-inline>
</p>
<p>
Missions are completable objectives with specific types. <br />
Missions are completable objectives with specific types, such as DEAD, BAI, STRIKE, or SAM. <br />
Randomized missions can be defined using the format: <span
class="inline-lua"><span class="lua-variable">RANDOMMISSION_[Type]_[Name]_[Index]</span></span>.
</p>
<p>
Valid Types:
<ul>
<li>SAM</li>
<li>DEAD</li>
<li>BAI</li>
<li>CAS</li>
<li>STRIKE</li>
</ul>
</p>
<h3 id="cap-routes">CAP Routes</h3>
<p>
<strong>Format:</strong> <code-inline>CAPROUTE_[routeID]_[Name]</code-inline> <br />
+88 -4
View File
@@ -5,7 +5,12 @@ on:
branches:
- main
paths:
- '_docs/**'
- '.docs/**'
env:
DOCKER_REGISTRY: registry.dutchie031.net
DOCKER_IMAGE: spearhead-docs
DOCKER_TAG: latest
jobs:
## Run replacements and cleanups on the docs
@@ -17,16 +22,45 @@ jobs:
with:
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
uses: actions/upload-artifact@v3
with:
name: spearhead-docs
path: ./.docs/**/*
path: |
./.docs/Dockerfile
./.docs/web/**/*
retention-days: 1
build-image:
runs-on: ubuntu-latest
needs: prepare-docs
steps:
# Download prepared pages from the previous job
@@ -34,11 +68,61 @@ jobs:
uses: actions/download-artifact@v3
with:
name: spearhead-docs
path: ./spearhead-docs
- name: DEBUG ls
run: |
ls -R ./spearhead-docs
- name: Build Docker image for docs
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
+49
View File
@@ -0,0 +1,49 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.app }}
namespace: spearhead-docs
spec:
selector:
app: {{ .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:
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
ingressClassName: nginx
rules:
- host: spearhead.dutchie031.com
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.com
- 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