Initial commit: ATLAS Dashboard (Next.js)

This commit is contained in:
2026-02-13 12:24:02 -05:00
commit d6debe51b1
72 changed files with 16965 additions and 0 deletions

54
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: Build & Test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Build
run: npm run build
- name: Build Docker image
run: docker build -t atlas-dashboard:test .
- name: Test Docker image
run: |
docker run --rm -p 3000:3000 \
-e DOCKER_HOST="http://mock:2375" \
-e UNIFI_HOST="mock" \
-e UNIFI_USERNAME="test" \
-e UNIFI_PASSWORD="test" \
-e SYNOLOGY_HOST="mock" \
-e SYNOLOGY_USERNAME="test" \
-e SYNOLOGY_PASSWORD="test" \
atlas-dashboard:test &
sleep 10
curl -f http://localhost:3000/ || exit 1
kill %1 || true

84
.github/workflows/deploy.yml vendored Normal file
View File

@@ -0,0 +1,84 @@
name: Deploy to Atlas Server
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy to Atlas Server
env:
ATLAS_HOST: ${{ secrets.ATLAS_HOST }}
ATLAS_USER: ${{ secrets.ATLAS_USER }}
ATLAS_SSH_KEY: ${{ secrets.ATLAS_SSH_KEY }}
run: |
# Setup SSH
mkdir -p ~/.ssh
echo "$ATLAS_SSH_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -H $ATLAS_HOST >> ~/.ssh/known_hosts
# Deploy
ssh $ATLAS_USER@$ATLAS_HOST << 'EOF'
set -e
echo "📦 Starting deployment..."
# Navigate to deploy directory
mkdir -p /opt/dashboard
cd /opt/dashboard
# Clone or update repo
if [ -d .git ]; then
echo "🔄 Updating repository..."
git pull origin main
else
echo "🔄 Cloning repository..."
git clone https://github.com/mblanke/Dashboard.git .
fi
# Check .env.local exists
if [ ! -f .env.local ]; then
echo "❌ .env.local not found. Please create it on the server."
exit 1
fi
# Build and deploy
echo "🔨 Building Docker image..."
docker-compose build --no-cache
echo "🚀 Deploying container..."
docker-compose up -d
# Wait and verify
sleep 5
if docker-compose ps | grep -q "Up"; then
echo "✅ Deployment successful!"
docker-compose logs --tail=20 dashboard
else
echo "❌ Deployment failed"
docker-compose logs dashboard
exit 1
fi
EOF
- name: Notify deployment status
if: always()
uses: actions/github-script@v6
with:
script: |
const status = '${{ job.status }}';
const message = status === 'success'
? '✅ Dashboard deployed successfully to Atlas server (100.104.196.38:3001)'
: '❌ Dashboard deployment failed. Check logs for details.';
core.notice(message);