v0.2.1 — dashboard visuals + deploy pipeline
Piece 1 — Visuals - Add KPI bento bar (score tile with run-health pill, cost tile, last-run tile). Run-health pill shows 'All models healthy' / 'N model(s) degraded' / 'No run yet' sourced from PRV_Model_Registry health fields via collector. - Add config-change trendline marker: inline configMarker Chart.js plugin draws a vertical dashed orange line + pin at every config_version boundary. Legend swatch + annotation note appear when breaks exist. - Chart sits in fixed .prv-chartbox (300px); typeof-Chart guard + .prv-noscript fallback — cannot grow layout, degrades gracefully offline. - PRV_Dashboard_Renderer: new class owns bento tile + trendline rendering. PRV_Ai_Visibility_Panel is now a thin orchestrator (237 lines). - PRV_Ai_Visibility_Collector: trendline query now includes MIN(config_version) per run; collect() adds last_run_counts and config_versions to payload. - PRV_Admin_Page: get_dashboard_css() returns Assay dark palette CSS. Piece 2 — Deploy pipeline - .github/workflows/deploy.yml: on push to main, runs CI, rsyncs plugin to Hostinger PROD (excl. .git .github tests phpunit composer vendor phpcs *.md), purges LiteSpeed, health-checks (200/403). Standalone — not smoke-gated. DoD - Version 0.2.1 in header + constant; CHANGELOG, ARCHITECTURE, CONVENTIONS, CONTEXT all updated same commit. - tests/unit/test-dashboard-panel.php: 27 assertions. - Pre-push checks: no PHP built-in name shadows in bootstrap.php; all includes/*.php files <= 300 lines (max: 298).
This commit is contained in:
70
.github/workflows/deploy.yml
vendored
Normal file
70
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
name: Deploy to Hostinger
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: deploy-pr-vision
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: Pre-deploy CI
|
||||
uses: ./.github/workflows/ci.yml
|
||||
|
||||
deploy:
|
||||
name: Deploy (rsync to Hostinger PROD)
|
||||
needs: ci
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_deploy
|
||||
chmod 600 ~/.ssh/id_deploy
|
||||
ssh-keyscan -p "${{ secrets.SSH_PORT }}" "${{ secrets.SSH_HOST }}" >> ~/.ssh/known_hosts 2>/dev/null
|
||||
|
||||
- name: rsync plugin to PROD
|
||||
run: |
|
||||
rsync -az --delete \
|
||||
--exclude='.git' \
|
||||
--exclude='.github' \
|
||||
--exclude='tests' \
|
||||
--exclude='phpunit.xml.dist' \
|
||||
--exclude='composer.json' \
|
||||
--exclude='composer.lock' \
|
||||
--exclude='vendor' \
|
||||
--exclude='phpcs.xml.dist' \
|
||||
--exclude='*.md' \
|
||||
-e "ssh -p ${{ secrets.SSH_PORT }} -i ~/.ssh/id_deploy -o StrictHostKeyChecking=no" \
|
||||
./ \
|
||||
"${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:~/domains/peptiderepo.com/public_html/wp-content/plugins/pr-vision/"
|
||||
|
||||
- name: Purge LiteSpeed cache
|
||||
run: |
|
||||
ssh -p "${{ secrets.SSH_PORT }}" \
|
||||
-i ~/.ssh/id_deploy \
|
||||
-o StrictHostKeyChecking=no \
|
||||
"${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}" \
|
||||
'wp --path=~/domains/peptiderepo.com/public_html litespeed-purge all 2>/dev/null || true'
|
||||
|
||||
- name: Health check (expect 200 or 403)
|
||||
run: |
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
--max-time 15 \
|
||||
"https://peptiderepo.com/wp-admin/admin.php?page=pr-vision" \
|
||||
-L --user-agent "GitHub-Actions-Deploy-Health-Check/1.0")
|
||||
echo "HTTP status: $STATUS"
|
||||
if [ "$STATUS" = "200" ] || [ "$STATUS" = "403" ]; then
|
||||
echo "Health check passed."
|
||||
else
|
||||
echo "Health check FAILED with status $STATUS"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user