diff --git a/.docs/web/index.html b/.docs/web/index.html index 511d204..ce5d405 100644 --- a/.docs/web/index.html +++ b/.docs/web/index.html @@ -21,6 +21,9 @@
+ +
+

Quick Links

  • Tutorials
  • @@ -59,6 +62,13 @@

    © 2025 Spearhead Project

    + + \ No newline at end of file diff --git a/.docs/web/js/components/sidebar.js b/.docs/web/js/components/sidebar.js index 3724238..870aacf 100644 --- a/.docs/web/js/components/sidebar.js +++ b/.docs/web/js/components/sidebar.js @@ -168,8 +168,14 @@ class Sidebar extends HTMLElement { } render() { + var betaHtml = ''; + if (window.location.hostname.toLowerCase() == 'beta.spearhead.rocks') { + betaHtml = 'You are looking at docs that are released with the beta version.'; + } + this.innerHTML = `
    + ${betaHtml}

      diff --git a/.gitea/workflows/update-docs.yml b/.gitea/workflows/update-docs.yml index 88ee6a7..185db62 100644 --- a/.gitea/workflows/update-docs.yml +++ b/.gitea/workflows/update-docs.yml @@ -4,13 +4,14 @@ on: push: branches: - main + - develop paths: - '.docs/**' env: DOCKER_REGISTRY: registry.dutchie031.net DOCKER_IMAGE: spearhead-docs - DOCKER_TAG: latest + DOCKER_TAG: ${{ github.ref_name == 'main' && 'latest' || 'beta' }} jobs: ## Run replacements and cleanups on the docs @@ -36,7 +37,7 @@ jobs: 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 + - name: Highlight Config 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 @@ -105,15 +106,30 @@ jobs: chmod 600 $HOME/.kube/config cat $HOME/.kube/config - - name: Run Helm upgrade/install + - name: Run Helm upgrade/install spearhead-docs (main) + if: github.ref_name == 'main' run: | helm upgrade --install spearhead-docs .helm \ --namespace spearhead-docs \ --create-namespace \ + -f .helm/values.yaml \ --set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \ --set image.tag=${{ env.DOCKER_TAG }} \ --wait + - name: Run Helm upgrade/install spearhead-docs (develop) + if: github.ref_name == 'develop' + run: | + helm upgrade --install spearhead-docs-beta .helm \ + --namespace spearhead-docs \ + --create-namespace \ + -f .helm/values.yaml \ + -f .helm/values.beta.yaml \ + --set image.repository=${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }} \ + --set image.tag=${{ env.DOCKER_TAG }} \ + --wait + + # - name: 'Deploy' # uses: deliverybot/helm@v1 # with: diff --git a/.helm/Chart.yaml b/.helm/Chart.yaml index 1c81b9f..7c8d14d 100644 --- a/.helm/Chart.yaml +++ b/.helm/Chart.yaml @@ -13,4 +13,5 @@ sources: - https://git.dutchie031.com/Spearhead/Spearhead maintainers: - name: Spearhead Team + \ No newline at end of file diff --git a/.helm/templates/deployment.yaml b/.helm/templates/deployment.yaml index 77416f3..a4c28fc 100644 --- a/.helm/templates/deployment.yaml +++ b/.helm/templates/deployment.yaml @@ -25,7 +25,7 @@ spec: type: RuntimeDefault containers: - name: {{ .Values.app }} - image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: Always ports: - containerPort: {{ .Values.ports.containerPort }} diff --git a/.helm/templates/network.yaml b/.helm/templates/network.yaml index e50e6e2..ccf5984 100644 --- a/.helm/templates/network.yaml +++ b/.helm/templates/network.yaml @@ -14,7 +14,7 @@ spec: apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ .Values.app }}-ingress + name: "{{ .Values.app }}-ingress" namespace: spearhead-docs annotations: kubernetes.io/tls-acme: "true" @@ -22,28 +22,21 @@ metadata: spec: ingressClassName: nginx rules: - - host: spearhead.dutchie031.com + {{- range .Values.ingress.hosts }} + - host: {{ . }} http: paths: - path: / pathType: Prefix backend: service: - name: {{ .Values.app }} + 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 }} + number: {{ $.Values.ports.servicePort }} + {{- end }} tls: - hosts: - - spearhead.dutchie031.com - - spearhead.rocks - secretName: spearhead-docs-tls \ No newline at end of file + {{- range .Values.ingress.hosts }} + - {{ . }} + {{- end }} + secretName: "{{ .Values.app }}-docs-tls" \ No newline at end of file diff --git a/.helm/values.beta.yaml b/.helm/values.beta.yaml new file mode 100644 index 0000000..f315486 --- /dev/null +++ b/.helm/values.beta.yaml @@ -0,0 +1,9 @@ + +app: spearhead-docs-beta + +image: + tag: "beta" + +ingress: + hosts: + - beta.spearhead.rocks \ No newline at end of file diff --git a/.helm/values.yaml b/.helm/values.yaml index 499fdcb..64be075 100644 --- a/.helm/values.yaml +++ b/.helm/values.yaml @@ -1,10 +1,15 @@ - -app: spearhead-docs - -image: - repository: registry.dutchie031.net/spearhead-docs - tag: latest - -ports: - servicePort: 80 - containerPort: 80 \ No newline at end of file + +app: spearhead-docs + +image: + repository: registry.dutchie031.net/spearhead-docs + tag: latest + +ports: + servicePort: 80 + containerPort: 80 + +ingress: + hosts: + - spearhead.dutchie031.com + - spearhead.rocks \ No newline at end of file