Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
client/src/api/generated/ linguist-generated=true
4 changes: 0 additions & 4 deletions .github/workflows/client-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,5 @@ jobs:
run: npx prettier --check "src/**/*.{ts,tsx}"
working-directory: client

- name: Fix Prettier formatting
run: npm run format
working-directory: client
if: failure()


98 changes: 48 additions & 50 deletions .github/workflows/deploy_docker.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,48 @@
name: Deploy Docker Images

on:
push:
branches:
- mainx

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: AWS
url: 'https://client.${{ vars.EC2_PUBLIC_IP }}.nip.io'
steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Copy Docker Compose File From Repo to VM Host
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ vars.EC2_PUBLIC_IP }}
username: ${{ vars.AWS_EC2_USER }}
key: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
source: "./compose.aws.yml"
target: /home/${{ vars.AWS_EC2_USER }}

- name: SSH to VM and Create .env.prod
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ vars.EC2_PUBLIC_IP }}
username: ${{ vars.AWS_EC2_USER }}
key: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
script: |
rm .env.prod
touch .env.prod
echo "CLIENT_HOST=client.${{ vars.EC2_PUBLIC_IP }}.nip.io" >> .env.prod
echo "SERVER_HOST=api.${{ vars.EC2_PUBLIC_IP }}.nip.io" >> .env.prod
echo "PUBLIC_API_URL=https://api.${{ vars.EC2_PUBLIC_IP }}.nip.io/api" >> .env.prod

- name: SSH to VM and Execute Docker-Compose Up
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ vars.EC2_PUBLIC_IP }}
username: ${{ vars.AWS_EC2_USER }}
key: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
script: |
echo "Logging into Docker registry..."
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
echo "Starting Docker Compose..."
docker compose -f compose.aws.yml --env-file=.env.prod up --pull=always -d
#name: Deploy Docker Images
#
#on:
# push:
#
#jobs:
# deploy:
# runs-on: ubuntu-latest
# environment:
# name: AWS
# url: 'https://client.${{ vars.EC2_PUBLIC_IP }}.nip.io'
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
#
# - name: Copy Docker Compose File From Repo to VM Host
# uses: appleboy/scp-action@v0.1.7
# with:
# host: ${{ vars.EC2_PUBLIC_IP }}
# username: ${{ vars.AWS_EC2_USER }}
# key: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
# source: "./compose.aws.yml"
# target: /home/${{ vars.AWS_EC2_USER }}
#
# - name: SSH to VM and Create .env.prod
# uses: appleboy/ssh-action@v1.0.3
# with:
# host: ${{ vars.EC2_PUBLIC_IP }}
# username: ${{ vars.AWS_EC2_USER }}
# key: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
# script: |
# rm .env.prod
# touch .env.prod
# echo "CLIENT_HOST=client.${{ vars.EC2_PUBLIC_IP }}.nip.io" >> .env.prod
# echo "SERVER_HOST=api.${{ vars.EC2_PUBLIC_IP }}.nip.io" >> .env.prod
# echo "PUBLIC_API_URL=https://api.${{ vars.EC2_PUBLIC_IP }}.nip.io/api" >> .env.prod
#
# - name: SSH to VM and Execute Docker-Compose Up
# uses: appleboy/ssh-action@v1.0.3
# with:
# host: ${{ vars.EC2_PUBLIC_IP }}
# username: ${{ vars.AWS_EC2_USER }}
# key: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
# script: |
# echo "Logging into Docker registry..."
# echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
# echo "Starting Docker Compose..."
# docker compose -f compose.aws.yml --env-file=.env.prod up --pull=always -d
1 change: 1 addition & 0 deletions client/.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_API_URL=https://api.teamserverdown.devops.aet.cit.tum.de
9 changes: 6 additions & 3 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Install dependencies only when needed
FROM node:18-alpine AS deps
FROM node:24.2-bullseye-slim AS deps

RUN apt update && apt install --yes --no-install-recommends curl default-jre

# Set working directory
WORKDIR /app
Expand All @@ -9,7 +11,7 @@ COPY package.json package-lock.json ./
RUN npm ci

# Rebuild the source code only when needed
FROM node:20-slim AS builder
FROM node:24.2-slim AS builder
WORKDIR /app

COPY . .
Expand All @@ -20,7 +22,8 @@ COPY --from=deps /app/node_modules ./node_modules
RUN npm run build

# Production image
FROM node:20-alpine AS runner
FROM node:24.2-alpine3.21 AS runner
WORKDIR /app

ENV NODE_ENV=production

Expand Down
1 change: 1 addition & 0 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next

## Deploy on Vercel


The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Expand Down
7 changes: 7 additions & 0 deletions client/openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.13.0"
}
}
Loading