Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 263e0dd

Browse files
committed
chore: add changes made for stp 25
1 parent 36f7bb7 commit 263e0dd

File tree

9 files changed

+5799
-5526
lines changed

9 files changed

+5799
-5526
lines changed

.github/workflows/ci-cd.yml

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,53 @@
1-
name: CI/CD
1+
name: Deploy
22

33
on:
4-
- push
4+
push:
5+
tags:
6+
- 'v*'
57

68
jobs:
7-
deployment:
8-
name: Deployment Setup
9+
backend:
10+
name: Backend
911
runs-on: ubuntu-latest
1012
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
1115
- name: Set Deployment Options
1216
id: deployment
1317
run: |
1418
case "$GITHUB_REF" in
1519
refs/tags/v*)
1620
VERSION="${GITHUB_REF:11}"
17-
PREFIX="${GITHUB_REF:11:1}"
21+
MAJOR="${GITHUB_REF:11:1}"
1822
;;
1923
esac
20-
echo "::set-output name=version::$VERSION"
21-
echo "::set-output name=prefix::$PREFIX"
22-
outputs:
23-
version: ${{ steps.deployment.outputs.version }}
24-
prefix: ${{ steps.deployment.outputs.prefix }}
25-
26-
backend:
27-
name: Backend
28-
runs-on: ubuntu-latest
29-
needs: [ deployment ]
30-
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v1
33-
- name: Build the Docker Image
34-
if: needs.deployment.outputs.version
35-
uses: whoan/docker-build-with-cache-action@v5
24+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
25+
echo "major=$MAJOR" >> "$GITHUB_OUTPUT"
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
- name: Login to Docker Hub
29+
uses: docker/login-action@v3
3630
with:
31+
registry: ${{ secrets.DOCKER_REGISTRY }}
3732
username: ${{ secrets.DOCKER_USERNAME }}
3833
password: ${{ secrets.DOCKER_PASSWORD }}
39-
registry: ${{ secrets.DOCKER_REGISTRY }}
40-
image_name: stp/settlers
41-
image_tag: ${{ needs.deployment.outputs.prefix }},${{ needs.deployment.outputs.version }}
34+
- name: Build and push
35+
uses: docker/build-push-action@v5
36+
with:
37+
context: .
38+
push: true
39+
tags: |
40+
${{ secrets.DOCKER_REGISTRY }}/stp/settlers:${{ steps.deployment.outputs.version }}
41+
${{ secrets.DOCKER_REGISTRY }}/stp/settlers:${{ steps.deployment.outputs.major }}
42+
cache-to: type=gha,mode=max
43+
cache-from: type=gha
4244
- name: Rancher Deploy
43-
if: needs.deployment.outputs.version
44-
uses: sekassel-research/actions-rancher-update@2.0.2
45+
uses: sekassel-research/actions-rancher-update@v3.0.0
4546
with:
4647
rancher_url: ${{ secrets.RANCHER_URL }}
4748
rancher_token: ${{ secrets.RANCHER_TOKEN }}
4849
cluster_id: ${{ secrets.CLUSTER_ID }}
4950
project_id: ${{ secrets.PROJECT_ID }}
5051
namespace: ${{ secrets.NAMESPACE }}
51-
deployment: ${{ secrets.DEPLOYMENT }}-v${{ needs.deployment.outputs.prefix }}
52-
docker_image: ${{ secrets.DOCKER_REGISTRY }}/stp/settlers:${{ needs.deployment.outputs.version }}
53-
- name: Discord Notification
54-
if: needs.deployment.outputs.version
55-
env:
56-
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
57-
uses: Ilshidur/action-discord@master
58-
with:
59-
args: |
60-
Eine neue Serverversion ist verfügbar: `${{ needs.deployment.outputs.version }}`
61-
<https://pioneers.uniks.de/api/v${{ needs.deployment.outputs.prefix }}>
52+
deployment: ${{ secrets.DEPLOYMENT }}-v${{ steps.deployment.outputs.major }}
53+
docker_image: ${{ secrets.DOCKER_REGISTRY }}/stp/settlers:${{ steps.deployment.outputs.version }}

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
FROM node:16-slim as builder
1+
FROM node:22-slim as builder
22
RUN npm install -g pnpm
33
WORKDIR /app
4-
COPY package.json pnpm-lock.yaml ./
4+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
55
RUN pnpm install
66
COPY . .
77
RUN pnpm run build
88

9-
FROM node:16-slim
9+
FROM node:22-slim
1010
RUN npm install -g pnpm
1111
WORKDIR /app
1212
ENV NODE_ENV=production
13-
COPY package.json pnpm-lock.yaml ./
13+
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
1414
RUN pnpm install
1515
COPY --from=builder /app/dist ./dist
1616
COPY docs ./docs

package.json

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stpst22-server",
33
"version": "0.0.1",
4-
"description": "The server for the STP in summer term 2022",
4+
"description": "The server for the STP in summer term 2022 and 2025",
55
"author": "Adrian Kunz",
66
"private": true,
77
"license": "UNLICENSED",
@@ -20,58 +20,65 @@
2020
"test:e2e": "jest --config ./test/jest-e2e.json"
2121
},
2222
"dependencies": {
23-
"@nestjs/common": "^8.4.7",
24-
"@nestjs/core": "^8.4.7",
25-
"@nestjs/event-emitter": "^1.1.1",
26-
"@nestjs/jwt": "^8.0.1",
27-
"@nestjs/mapped-types": "^1.0.1",
28-
"@nestjs/microservices": "^8.4.7",
29-
"@nestjs/mongoose": "^8.0.1",
30-
"@nestjs/passport": "^8.2.2",
31-
"@nestjs/platform-express": "^8.4.7",
32-
"@nestjs/platform-ws": "^8.4.7",
33-
"@nestjs/schedule": "^1.1.0",
34-
"@nestjs/swagger": "^5.2.1",
35-
"@nestjs/throttler": "^2.0.1",
36-
"@nestjs/websockets": "^8.4.7",
37-
"bcrypt": "^5.0.1",
23+
"@nestjs/common": "^11.0.12",
24+
"@nestjs/core": "^11.0.12",
25+
"@nestjs/event-emitter": "^3.0.1",
26+
"@nestjs/jwt": "^11.0.0",
27+
"@nestjs/mapped-types": "^2.1.0",
28+
"@nestjs/microservices": "^11.0.12",
29+
"@nestjs/mongoose": "^11.0.3",
30+
"@nestjs/passport": "^11.0.5",
31+
"@nestjs/platform-express": "^11.0.12",
32+
"@nestjs/platform-ws": "^11.0.12",
33+
"@nestjs/schedule": "^5.0.1",
34+
"@nestjs/swagger": "^11.1.0",
35+
"@nestjs/throttler": "^6.4.0",
36+
"@nestjs/websockets": "^11.0.12",
37+
"bcrypt": "^5.1.1",
3838
"class-transformer": "^0.5.1",
39-
"class-validator": "^0.13.2",
40-
"express": "^4.18.1",
41-
"memoizee": "^0.4.15",
42-
"mongoose": "^5.13.14",
43-
"nats": "^2.7.1",
44-
"passport": "^0.5.3",
45-
"passport-jwt": "^4.0.0",
46-
"reflect-metadata": "^0.1.13",
47-
"rimraf": "^3.0.2",
48-
"rxjs": "^7.5.5",
49-
"swagger-ui-express": "^4.4.0"
39+
"class-validator": "^0.14.1",
40+
"cron": "^4.1.3",
41+
"express": "^5.1.0",
42+
"glob": "^11.0.1",
43+
"memoizee": "^0.4.17",
44+
"mongoose": "^8.13.1",
45+
"nats": "^2.29.3",
46+
"passport": "^0.7.0",
47+
"passport-jwt": "^4.0.1",
48+
"reflect-metadata": "^0.2.2",
49+
"rimraf": "^6.0.1",
50+
"rxjs": "^7.8.2"
5051
},
5152
"devDependencies": {
52-
"@nestjs/cli": "^8.2.8",
53-
"@nestjs/schematics": "^8.0.11",
54-
"@nestjs/testing": "^8.4.7",
55-
"@types/bcrypt": "^5.0.0",
56-
"@types/cron": "^1.7.3",
57-
"@types/express": "^4.17.13",
58-
"@types/jest": "^26.0.24",
59-
"@types/memoizee": "^0.4.8",
60-
"@types/node": "^16.11.42",
61-
"@types/passport-jwt": "^3.0.6",
62-
"@types/supertest": "^2.0.12",
63-
"@types/validator": "^13.7.3",
64-
"@typescript-eslint/eslint-plugin": "^4.33.0",
65-
"@typescript-eslint/parser": "^4.33.0",
66-
"eslint": "^7.32.0",
67-
"jest": "^26.6.3",
68-
"supertest": "^6.2.4",
69-
"ts-jest": "^26.5.6",
70-
"ts-loader": "^8.4.0",
71-
"ts-node": "^9.1.1",
72-
"tsconfig-paths": "^3.14.1",
73-
"typescript": "^4.7.4",
74-
"webpack": "^5.73.0"
53+
"@nestjs/cli": "^11.0.5",
54+
"@nestjs/schematics": "^11.0.2",
55+
"@nestjs/testing": "^11.0.12",
56+
"@types/bcrypt": "^5.0.2",
57+
"@types/express": "^5.0.1",
58+
"@types/jest": "^29.5.14",
59+
"@types/memoizee": "^0.4.12",
60+
"@types/node": "^22.13.17",
61+
"@types/passport-jwt": "^4.0.1",
62+
"@types/supertest": "^6.0.3",
63+
"@types/validator": "^13.12.3",
64+
"@typescript-eslint/eslint-plugin": "^8.29.0",
65+
"@typescript-eslint/parser": "^8.29.0",
66+
"eslint": "^9.23.0",
67+
"jest": "^29.7.0",
68+
"supertest": "^7.1.0",
69+
"ts-jest": "^29.3.1",
70+
"ts-loader": "^9.5.2",
71+
"ts-node": "^10.9.2",
72+
"tsconfig-paths": "^4.2.0",
73+
"typescript": "^5.8.2",
74+
"webpack": "^5.98.0"
75+
},
76+
"resolutions": {
77+
"glob": "^11.0.1",
78+
"npmlog": "^7.0.1",
79+
"rimraf": "^6.0.1",
80+
"gauge": "^5.0.2",
81+
"are-we-there-yet": "^4.0.2"
7582
},
7683
"jest": {
7784
"moduleFileExtensions": [

0 commit comments

Comments
 (0)