diff --git a/scripts/build_news_json.py b/scripts/build_news_json.py index 10a86b67..8359604a 100644 --- a/scripts/build_news_json.py +++ b/scripts/build_news_json.py @@ -9,6 +9,7 @@ This reads all .html files from the `news/` directory and creates """ import json +import os import sys from pathlib import Path @@ -41,4 +42,14 @@ def build_news_json() -> None: if __name__ == "__main__": + deploy = False + for arg in sys.argv[1:]: + if arg == "--deploy": + deploy = True + build_news_json() + + if deploy: + user = os.getenv("HADES_USER") + assert user, "HADES_USER environment variable must be set to deploy news.json to Hades" + os.system(f"scp news/news.json {user}@hades:/var/www/html/oraios-software/serena_news.json") diff --git a/src/serena/dashboard.py b/src/serena/dashboard.py index 528af993..3c33f1a2 100644 --- a/src/serena/dashboard.py +++ b/src/serena/dashboard.py @@ -630,7 +630,7 @@ class SerenaDashboardAPI: # ===== Remote News Methods ===== # The branch from which news are fetched. Change to a feature branch for testing. - _NEWS_JSON_URL = "https://raw.githubusercontent.com/oraios/serena/main/news/news.json" + _NEWS_JSON_URL = "https://oraios-software.de/serena_news.json" def _fetch_news(self) -> None: """Fetch news.json from GitHub using ETag-based caching and store in memory. Silently ignores network errors."""