9 Commits

Author SHA1 Message Date
2c805ab513 dont publish if lint fails
All checks were successful
CI / build (push) Successful in 13s
CI / lint (push) Successful in 9s
CI / create-and-publish-docker-image (push) Successful in 11s
CI / build (pull_request) Successful in 12s
CI / lint (pull_request) Successful in 9s
CI / create-and-publish-docker-image (pull_request) Successful in 12s
2025-08-31 18:22:15 +02:00
2b21310dfb add githooks and setup.sh 2025-08-31 18:22:15 +02:00
756e709181 correct permission on shell script 2025-08-31 18:22:15 +02:00
9872b64fbd create git hash html 2025-08-31 18:22:15 +02:00
b6c9c51ec3 docker image now uses dist folder from build step for deploy 2025-08-31 18:22:15 +02:00
83f872577b ensure git-hash.js is in dist folder 2025-08-31 18:22:15 +02:00
2b489e83ba write git sha env variable into docker container 2025-08-31 18:22:15 +02:00
6189b80ff1 Bouncing Amogus
All checks were successful
CI / build (push) Successful in 12s
CI / lint (push) Successful in 11s
CI / create-and-publish-docker-image (push) Successful in 19s
2025-08-31 18:21:01 +02:00
df2999516d auto restart firefox after publish; write git hash into file for server
All checks were successful
CI / build (push) Successful in 13s
CI / lint (push) Successful in 10s
CI / create-and-publish-docker-image (push) Successful in 18s
2025-08-31 16:48:10 +02:00
10 changed files with 42 additions and 24 deletions

View File

@@ -18,6 +18,8 @@ jobs:
run: bun install run: bun install
- name: Build - name: Build
run: bun run build run: bun run build
- name: Write Git-Hash into html
run: ./pipeline/create-git-hash-html.sh
- name: Create Build Artifact - name: Create Build Artifact
uses: christopherhx/gitea-upload-artifact@v4 uses: christopherhx/gitea-upload-artifact@v4
with: with:
@@ -39,8 +41,8 @@ jobs:
- name: Run Biome - name: Run Biome
run: biome ci . run: biome ci .
build-and-push-docker: create-and-publish-docker-image:
needs: [build] needs: [lint]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -58,7 +60,6 @@ jobs:
run: docker build -t git.rivercry.com/wg/monitor-im-flur . run: docker build -t git.rivercry.com/wg/monitor-im-flur .
- name: Push Docker image - name: Push Docker image
run: docker push git.rivercry.com/wg/monitor-im-flur run: docker push git.rivercry.com/wg/monitor-im-flur
- name: Deploy via SSH - name: Deploy via SSH
uses: appleboy/ssh-action@v0.1.10 uses: appleboy/ssh-action@v0.1.10
with: with:
@@ -68,7 +69,8 @@ jobs:
password: ${{ secrets.GARRISON_DOCKER_PASSWORD }} password: ${{ secrets.GARRISON_DOCKER_PASSWORD }}
script: | script: |
cd monitor-im-flur cd monitor-im-flur
echo "Deploying Docker container..." hyprctl dispatch exec 'pkill firefox'
hyprctl dispatch exec 'firefox -kiosk localhost:9123'
git clean -dfx git clean -dfx
git reset --hard HEAD git reset --hard HEAD
git pull git pull

View File

@@ -1,11 +1,5 @@
FROM oven/bun as builder
WORKDIR /app
COPY . .
RUN bun install
RUN bun run build
FROM nginx:alpine FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html COPY ./dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

12
githooks/pre-commit Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
echo "Running pre-commit hooks..."
biome check --write
biome lint --write
if git diff --quiet; then
exit 0
else
git add -u
fi

View File

@@ -16,7 +16,7 @@ http {
index index.html; index index.html;
location / { location / {
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html /git-hash.js;
} }
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {

View File

@@ -1 +0,0 @@
#!/bin/bash

View File

@@ -0,0 +1,11 @@
#!/bin/sh
echo "<!DOCTYPE html>
<html>
<head>
<title>Git Hash</title>
</head>
<body>
<pre>GITHUB_SHA = '$GITHUB_SHA';</pre>
</body>
</html>" > dist/git-hash.html

3
setup.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
git config --local core.hooksPath githooks

View File

@@ -1,9 +1,7 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import style from "./style.module.css";
import amogus from "/img/amogus.png"; import amogus from "/img/amogus.png";
import imposter from "/img/imposter.png"; import imposter from "/img/imposter.png";
import style from "./style.module.css";
type Amogus = { type Amogus = {
isImposter: boolean; isImposter: boolean;
@@ -51,7 +49,7 @@ const makeCrewmate = (crewmate: Amogus) => {
const stepCrewmates = (list: Amogus[]) => { const stepCrewmates = (list: Amogus[]) => {
const { innerWidth: width, innerHeight: height } = window; const { innerWidth: width, innerHeight: height } = window;
const newCrewmates = list.slice(); const newCrewmates = list.slice();
for (let c of newCrewmates) { for (const c of newCrewmates) {
let newX = c.posX + c.speedX; let newX = c.posX + c.speedX;
let newY = c.posY + c.speedY; let newY = c.posY + c.speedY;
if (newX > width - 90) { if (newX > width - 90) {
@@ -81,13 +79,13 @@ export default function Amogus() {
useEffect(() => { useEffect(() => {
const timer = setInterval(() => { const timer = setInterval(() => {
let c = crewmates; const c = crewmates;
setCrewmates(stepCrewmates(c)); setCrewmates(stepCrewmates(c));
}, 100); }, 100);
return () => { return () => {
clearInterval(timer); clearInterval(timer);
}; };
}, []); }, [crewmates]);
return <>{crewmates.map((c) => makeCrewmate(c))}</>; return <>{crewmates.map((c) => makeCrewmate(c))}</>;
} }

View File

@@ -1,4 +1,4 @@
.container { .container {
z-index: 100; z-index: 100;
position: absolute; position: absolute;
} }

View File

@@ -1,7 +1,7 @@
import classNames from "classnames";
import FourTwenty from "@components/FourTwenty/FourTwenty"; import FourTwenty from "@components/FourTwenty/FourTwenty";
import classNames from "classnames";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import Amogus from "@/components/Amogus/Amogus";
import Card from "@/components/Card/Card"; import Card from "@/components/Card/Card";
import { import {
CardColumn, CardColumn,
@@ -13,7 +13,6 @@ import Footer from "@/components/Footer/Footer";
import Terminal from "@/components/Terminal/Terminal"; import Terminal from "@/components/Terminal/Terminal";
import Timetable from "@/components/Timetable/Timetable"; import Timetable from "@/components/Timetable/Timetable";
import Weather from "@/components/Weather/Weather"; import Weather from "@/components/Weather/Weather";
import Amogus from "@/components/Amogus/Amogus";
import style from "./style.module.css"; import style from "./style.module.css";