Skip to content
This repository was archived by the owner on Aug 26, 2025. It is now read-only.

Commit 57d65db

Browse files
committed
initial
1 parent 4d00122 commit 57d65db

60 files changed

Lines changed: 3147 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Redeploy Images
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- compose/**
8+
- .github/workflows/deploy-compose.yml
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: "compose-deploy"
13+
cancel-in-progress: true
14+
15+
env:
16+
SUDO_PASSWORD: ${{ secrets.SUDO_PASSWORD }}
17+
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
18+
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
19+
SERVICE_FOLDER: /home/ftcontrol-docs
20+
REPO_FOLDER: compose
21+
22+
jobs:
23+
deploy:
24+
runs-on: lazarvps
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v4
28+
with:
29+
sparse-checkout: compose
30+
sparse-checkout-cone-mode: false
31+
32+
- name: Copy and set permissions
33+
run: |
34+
echo "$SUDO_PASSWORD" | sudo -S bash -c "
35+
mkdir -p $SERVICE_FOLDER
36+
cp -r $REPO_FOLDER/* $SERVICE_FOLDER
37+
"
38+
- name: Restart Docker Compose service
39+
run: |
40+
echo "$SUDO_PASSWORD" | sudo -S su -c "
41+
sudo docker login --username $REGISTRY_USER --password $REGISTRY_PASSWORD myregistry.bylazar.com
42+
cd $SERVICE_FOLDER
43+
docker compose up -d
44+
"

.github/workflows/deploy.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build FTControl Docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- lazarkit-website/**
8+
- test-codebase/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/examples/**
9+
- .github/workflows/deploy.yml
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: "docs-deploy"
14+
cancel-in-progress: true
15+
16+
env:
17+
SUDO_PASSWORD: ${{ secrets.SUDO_PASSWORD }}
18+
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
19+
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
20+
REPO_FOLDER: compose
21+
BASE_DIR: lazarkit-website
22+
SERVICE_FOLDER: /home/ftcontrol-docs
23+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
24+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
25+
IMAGE_NAME: myregistry.bylazar.com/ftcontrol-docs
26+
27+
jobs:
28+
build:
29+
name: Build and Deploy
30+
runs-on: lazarvps
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: ls
35+
run: ls -a
36+
- name: Build and Push Docker Image
37+
run: |
38+
echo "$SUDO_PASSWORD" | sudo -S bash -c "
39+
set -e
40+
sudo docker login --username $REGISTRY_USER --password $REGISTRY_PASSWORD myregistry.bylazar.com
41+
sudo docker build --pull --cache-from $IMAGE_NAME \
42+
--tag $IMAGE_NAME:$GITHUB_SHA \
43+
--tag $IMAGE_NAME:latest \
44+
. -f ./$BASE_DIR/Dockerfile
45+
sudo docker push $IMAGE_NAME:$GITHUB_SHA
46+
sudo docker push $IMAGE_NAME:latest
47+
"
48+
49+
deploy:
50+
runs-on: lazarvps
51+
needs: build
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
- name: Copy and set permissions
56+
run: |
57+
echo "$SUDO_PASSWORD" | sudo -S bash -c "
58+
mkdir -p $SERVICE_FOLDER
59+
cp -r $REPO_FOLDER/* $SERVICE_FOLDER
60+
"
61+
- name: Restart Docker Compose service
62+
run: |
63+
echo "$SUDO_PASSWORD" | sudo -S su -c "
64+
sudo docker login --username $REGISTRY_USER --password $REGISTRY_PASSWORD myregistry.bylazar.com
65+
cd $SERVICE_FOLDER
66+
docker compose down
67+
docker compose up -d
68+
"

compose/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
services:
2+
portfolio-worker:
3+
image: myregistry.bylazar.com/ftcontrol-docs:latest
4+
container_name: ftcontrol-docs
5+
restart: always
6+
networks:
7+
- lazar-network
8+
9+
networks:
10+
lazar-network:
11+
external: true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

lazarkit-website/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM oven/bun:latest AS build
2+
3+
WORKDIR /app
4+
5+
RUN apt-get update && apt-get install -y git
6+
7+
COPY ./lazarkit-website/package.json ./lazarkit-website/package.json
8+
COPY ./lazarkit-website/bun.lock ./lazarkit-website/bun.lock
9+
10+
COPY ./lazarkit-website ./lazarkit-website
11+
12+
RUN cd lazarkit-website && bun install
13+
14+
COPY ./test-codebase ./test-codebase
15+
16+
COPY ./library ./library
17+
18+
COPY ./ ./
19+
20+
RUN cd lazarkit-website && bun run build
21+
22+
# CMD ["sleep", "infinity"]
23+
24+
FROM busybox:latest AS runtime
25+
COPY --from=build /app/lazarkit-website/dist /www
26+
EXPOSE 80
27+
CMD ["httpd", "-f", "-v", "-p", "80", "-h", "/www"]

lazarkit-website/bun.lock

Lines changed: 1474 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazarkit-website/package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "lazarkit-website",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"private": true,
6+
"packageManager": "pnpm@9.15.0",
7+
"license": "MIT",
8+
"scripts": {
9+
"dev": "vite dev",
10+
"build": "vite build"
11+
},
12+
"devDependencies": {
13+
"@sveltejs/adapter-static": "^3.0.1",
14+
"@sveltejs/kit": "^2.8.1",
15+
"@sveltejs/vite-plugin-svelte": "^4.0.1",
16+
"@sveltepress/theme-default": "^6.0.2",
17+
"@sveltepress/vite": "^1.2.1",
18+
"@types/node": "^20.11.20",
19+
"svelte": "^5.0.0",
20+
"typescript": "^5.3.3",
21+
"vite": "^5.1.4"
22+
}
23+
}

lazarkit-website/src/app.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This help your get the type tips for sveltepress virtual modules
2+
/// <reference types="@sveltepress/theme-default/types" />
3+
/// <reference types="@sveltepress/vite/types" />
4+
5+
// See https://kit.svelte.dev/docs/types#app
6+
// for information about these interfaces
7+
8+
// and what to do when importing types
9+
declare namespace App {
10+
// interface Error {}
11+
// interface Locals {}
12+
// interface PageData {}
13+
// interface Platform {}
14+
}

lazarkit-website/src/app.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.svg" />
6+
<meta name="viewport" content="width=device-width" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div style="display: contents">%sveltekit.body%</div>
11+
</body>
12+
</html>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script>
2+
import { Link } from "@sveltepress/theme-default/components"
3+
const { children } = $props()
4+
</script>
5+
6+
<!-- Leave this. Or you can add more content for your custom layout -->
7+
{@render children?.()}
8+
9+
<p>
10+
A library by <Link to="https://bylazar.com" label="Lazar" /> from 19234 ByteForce.
11+
</p>
12+
13+
<style>
14+
p {
15+
text-align: center;
16+
}
17+
:global(a > span.title) {
18+
display: none;
19+
}
20+
</style>

0 commit comments

Comments
 (0)