deploy backend
Some checks failed
Deploy Backend / deploy (push) Failing after 27s
Deploy Website / deploy (push) Failing after 2m34s

This commit is contained in:
Lee 2024-10-04 21:46:49 +01:00
parent c1fe5f2884
commit 498492bb91
9 changed files with 85 additions and 16 deletions

View File

@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: scoresaber-reloaded-backend
namespace: public-services
spec:
replicas: 1
selector:
matchLabels:
app: scoresaber-reloaded-backend
template:
metadata:
labels:
app: scoresaber-reloaded-backend
spec:
containers:
- name: scoresaber-reloaded-backend-container
image: git.fascinated.cc/fascinated/scoresaber-reloaded-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 1000m # 1 vCPU
memory: 512Mi

View File

@ -0,0 +1,24 @@
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: scoresaber-reloaded-backend-ingress
namespace: public-services
annotations:
kubernetes.io/ingress.class: traefik-external
spec:
entryPoints:
- websecure
routes:
- match: Host(`ssr.fascinated.cc`) && PathPrefix(`/api`)
kind: Rule
middlewares:
- name: default-headers
namespace: traefik
- name: compress
namespace: traefik
services:
- name: scoresaber-reloaded-backend-service
port: 3000
tls:
secretName: fascinated-cc

View File

@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Service
metadata:
name: scoresaber-reloaded-backend-service
namespace: public-services
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: scoresaber-reloaded-backend

View File

@ -7,6 +7,8 @@ on:
- master
paths:
- backend/**
- .gitea/kubernetes/backend/**
- .gitea/workflows/deploy-backend.yml
jobs:
deploy:
@ -47,15 +49,15 @@ jobs:
with:
kubeconfig: ${{ secrets.KUBECONFIG }}
# - name: Deploy to Kubernetes
# uses: Azure/k8s-deploy@v5
# with:
# action: deploy
# namespace: public-services
# manifests: |
# .gitea/kubernetes/sealed-secrets.yaml
# .gitea/kubernetes/deployment.yaml
# .gitea/kubernetes/service.yaml
# .gitea/kubernetes/ingress.yaml
# images: |
# git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
- name: Deploy to Kubernetes
uses: Azure/k8s-deploy@v5
with:
action: deploy
namespace: public-services
manifests: |
.gitea/kubernetes/backend/sealed-secrets.yaml
.gitea/kubernetes/backend/deployment.yaml
.gitea/kubernetes/backend/service.yaml
.gitea/kubernetes/backend/ingress.yaml
images: |
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}

View File

@ -7,6 +7,8 @@ on:
- master
paths:
- website/**
- .gitea/kubernetes/website/**
- .gitea/workflows/deploy-website.yml
jobs:
deploy:
@ -53,9 +55,9 @@ jobs:
action: deploy
namespace: public-services
manifests: |
.gitea/kubernetes/sealed-secrets.yaml
.gitea/kubernetes/deployment.yaml
.gitea/kubernetes/service.yaml
.gitea/kubernetes/ingress.yaml
.gitea/kubernetes/website/sealed-secrets.yaml
.gitea/kubernetes/website/deployment.yaml
.gitea/kubernetes/website/service.yaml
.gitea/kubernetes/website/ingress.yaml
images: |
git.fascinated.cc/fascinated/scoresaber-reloaded-website:${{ github.sha }}