platform stuf, more praactice than productivity

This commit is contained in:
2025-12-08 22:51:35 -05:00
parent 139fe01f61
commit fcfe99adcf
4 changed files with 80 additions and 2 deletions

View File

@@ -0,0 +1,60 @@
name: Build, Dockerize and Deploy
on:
push:
branches: [ main ]
env:
IMAGE: ${{ secrets.DOCKER_REPOSITORY }}:${{ github.sha }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Cache Maven
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-
- name: Build with Maven (skip tests)
run: mvn -B package -DskipTests
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
run: docker build -t $IMAGE .
- name: Push Docker image
run: docker push $IMAGE
deploy:
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- name: Deploy to remote via SSH
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
docker pull $IMAGE
docker stop app || true
docker rm app || true
docker run -d --name app -p 8080:8080 --restart unless-stopped $IMAGE

View File

@@ -30,7 +30,8 @@ public class PlatformController {
p.getKey(),
p.getLabel(),
p.getCreatedAt(),
p.getUpdatedAt()
p.getUpdatedAt(),
p.getIsActive()
))
.toList();
}

View File

@@ -7,5 +7,6 @@ public record PlatformDto(
String key,
String label,
OffsetDateTime createdAt,
OffsetDateTime updatedAt
OffsetDateTime updatedAt,
Boolean is_active
) {}

View File

@@ -5,6 +5,20 @@
<head>
<title>Platform Manager</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
'onyx': '#000000',
'carbon': '#18181B',
'bone': '#F3F4F6',
'battl-amber': '#FBBF24'
}
}
}
}
</script>
</head>
<body class="bg-gray-100 min-h-screen">
<div class="container mx-auto px-4 py-8 max-w-7xl">
@@ -53,6 +67,7 @@
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Key</th>
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Label</th>
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Is Active</th>
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Created At</th>
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Updated At</th>
<th class="px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider">Actions</th>
@@ -105,6 +120,7 @@
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">\${platform.id}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">\${platform.key}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">\${platform.label}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">\${platform.is_active}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">\${formatDate(platform.createdAt)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">\${formatDate(platform.updatedAt)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">