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
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Cache Bun Dependencies
uses: actions/cache@v3
with:
path: "**/node_modules\n~/.bun"
key: "${{ runner.os }}-bun-${{ hashFiles('**/package.json') }}"

- name: Install Client Dependencies
working-directory: client
run: bun install

- name: Build Client
working-directory: client
run: bun run build

- name: Install Server Dependencies
working-directory: server
run: bun install
49 changes: 21 additions & 28 deletions .github/workflows/build-deploy.yml → .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
name: Build and Deploy
name: Deploy

on:
push:
branches: [master]
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
build:
deploy:
name: Deploy to Server
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "20"

- name: Install bun
run: |
npm install -g bun

- name: Build web client
run: |
cd client && bun install && bun run build

- name: Deploy using SSH
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
host: "${{ secrets.HOST }}"
username: "${{ secrets.USERNAME }}"
key: "${{ secrets.SSH_PRIVATE_KEY }}"
port: 22
script: |
set -e
cd /home

if [ ! -d "Server-Tracker" ]; then
Expand All @@ -40,25 +33,25 @@ jobs:

cd Server-Tracker
git reset --hard origin/master
git pull origin
git pull origin master

cd /home/Server-Tracker/client && bun install
cd client
bun install
rm -f .env
echo "FRONTEND_PORT=${{ secrets.FRONTEND_PORT }}" >> .env

echo "FRONTEND_PORT=${{ secrets.FRONTEND_PORT }}" > .env
bunx next build

cd /home/Server-Tracker/server && bun install
cd ../server
bun install
rm -f .env
echo "BACKEND_PORT=${{ secrets.BACKEND_PORT }}" > .env
echo "MONGODB_URL=${{ secrets.MONGODB_URL }}" >> .env

cd /home/Server-Tracker

cd ..
docker build ./client -t tracker-web
docker build ./server -t tracker-server

docker container prune --force
docker image prune --force

docker compose up -d
docker compose up -d
31 changes: 19 additions & 12 deletions client/dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
FROM ubuntu:latest

# Update the package list
RUN apt-get update && apt-get autoremove -y
FROM node:22-slim

# Environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive \
PATH="/root/.bun/bin:${PATH}"

ARG FRONTEND_PORT
ENV FRONTEND_PORT=$FRONTEND_PORT

# Install some basic tools
RUN apt-get install -y nano wget curl git unzip zip

# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install -y nodejs

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
zip \
nano \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set the working directory
COPY . /app
WORKDIR /app
Expand All @@ -27,6 +30,10 @@ RUN chmod +x /app/entrypoint.sh
# Install Bun
RUN curl -fsSL https://bun.sh/install | bash

# Add bun to PATH
ENV BUN_INSTALL="/root/.bun"
ENV PATH="$BUN_INSTALL/bin:$PATH"

# Expose the port
EXPOSE ${FRONTEND_PORT}

Expand Down
6 changes: 2 additions & 4 deletions client/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@

FRONTEND_PORT="${FRONTEND_PORT:-3006}"

~/.bun/bin/bun install
~/.bun/bin/bun next telemetry disable
~/.bun/bin/bun run build
~/.bun/bin/bun run start -- -H 0.0.0.0 -p "$FRONTEND_PORT"
bun next telemetry disable
bun run start -- -H 0.0.0.0 -p "$FRONTEND_PORT"
16 changes: 8 additions & 8 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tracker",
"version": "1.0.2",
"version": "1.0.3",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
Expand All @@ -10,22 +10,22 @@
"lint": "next lint"
},
"dependencies": {
"@next/third-parties": "^14.2.33",
"next": "16.1.5",
"@next/third-parties": "^14.2.35",
"next": "^16.1.6",
"next-sitemap": "^4.2.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.5.0",
"update-browserslist-db": "^1.1.4"
"update-browserslist-db": "^1.2.3"
},
"devDependencies": {
"typescript": "^5.9.3",
"@types/node": "^20.19.23",
"@types/react": "^18.3.26",
"@types/node": "^20.19.32",
"@types/react": "^18.3.28",
"@types/react-dom": "^18.3.7",
"postcss": "^8.5.6",
"tailwindcss": "^3.4.18",
"tailwindcss": "^3.4.19",
"eslint": "^8.57.1",
"eslint-config-next": "14.2.4"
}
}
}
2 changes: 1 addition & 1 deletion client/public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://track.rishon.systems</loc><lastmod>2026-01-21T21:28:44.876Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://track.rishon.systems</loc><lastmod>2026-02-06T10:05:16.720Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
6 changes: 4 additions & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
"@/*": [
"./src/*"
]
},
"target": "ES2017"
},
Expand Down
26 changes: 15 additions & 11 deletions server/dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM ubuntu:latest

# Update the package list
RUN apt-get update && apt-get autoremove -y
FROM node:22-slim

# Environment variables
ENV DEBIAN_FRONTEND=noninteractive
Expand All @@ -10,12 +7,17 @@ ARG BACKEND_PORT
ENV BACKEND_PORT=$BACKEND_PORT

# Install some basic tools
RUN apt-get install -y nano wget curl git unzip zip

# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt-get install -y nodejs
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
unzip \
zip \
nano \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Set the working directory
COPY . /server
Expand All @@ -27,7 +29,9 @@ RUN chmod +x /server/entrypoint.sh
# Install Bun
RUN curl -fsSL https://bun.sh/install | bash

RUN npm i -g bun
# Add bun to PATH
ENV BUN_INSTALL="/root/.bun"
ENV PATH="$BUN_INSTALL/bin:$PATH"

# Expose the port
EXPOSE ${BACKEND_PORT}
Expand Down
8 changes: 4 additions & 4 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "server",
"module": "index.ts",
"version": "1.0.1",
"version": "1.0.3",
"type": "module",
"scripts": {
"start": "bun run index.ts",
Expand All @@ -14,9 +14,9 @@
"typescript": "^5.9.2"
},
"dependencies": {
"@hytaleone/query": "^1.0.1",
"@hytaleone/query": "^1.1.1",
"dotenv": "^16.6.1",
"minecraft-server-ping": "^0.1.4",
"mongoose": "^8.19.2"
"mongoose": "^8.22.1"
}
}
}