Commit 258f58a9b3

258f58a9b334eda782f4ea279638af27e39ffea9

parent: fc8a4e5755

Unregistered key

cmc <hello@cleberg.net> · 2026-02-12 06:57 UTC
committer: <noreply@github.com>

clean up build, deploy, and env options (#2)

Layout: unified · split

.github/workflows/deploy.yml +5 −1
@@ -17,9 +17,13 @@ jobs:
1717 uses: actions/checkout@v4
1818
1919 - name: Run Build
20 env:
21 ENV: "prod"
22 BUILD: "true"
23 DEPLOY: "false"
2024 run: |
2125 echo "Environment is ready. Running build..."
22 echo "r" | ENV=prod uv run build.py
26 uv run build.py
2327
2428 - name: Upload Build Artifacts
2529 uses: actions/upload-artifact@v4
build.py +14 −38
@@ -249,8 +249,8 @@ def run_emacs_publish(dev_mode=True):
249249 print("Running Emacs publish script (production)...")
250250 result = subprocess.run(
251251 ["emacs", "--script", "publish.el"],
252 stdout=subprocess.PIPE,
253 stderr=subprocess.PIPE,
252 stdout=subprocess.DEVNULL,
253 stderr=subprocess.DEVNULL,
254254 text=True,
255255 )
256256
@@ -346,56 +346,32 @@ def main():
346346 css_min = theme_dir / "styles.min.css"
347347
348348 env = os.environ.get("ENV", "").casefold()
349 build = os.environ.get("BUILD", "").casefold() == "true"
349350 deploy = os.environ.get("DEPLOY", "").casefold() == "true"
350351
351 if deploy:
352 print("Deploying to production...")
353 deploy_to_server(build_dir, "homelab-remote")
354 return
355 else:
356 if env == "prod":
357 print("Environment: Production")
358
359 # Remove previous build
352 if env == "prod":
353 print("Environment: Production")
354 if build:
360355 remove_build_directory(build_dir)
361
362 # Minify CSS
363356 minify_css(css_src, css_min)
364
365 # Run publishing script (silenced output)
366357 run_emacs_publish(dev_mode=False)
367
368 # Update index page with latest posts
369358 update_index_html(html_snippet)
370
371 # Minify index page
372359 minify_html("./.build/index.html", "./.build/index.html")
373
374 # Generate sitemap
375360 generate_sitemap()
376
377 else:
378 print("Environment: Development")
379
380 # Remove previous build
361 if deploy:
362 print("Deploying to production...")
363 deploy_to_server(build_dir, "homelab-remote")
364 return
365 else:
366 print("Environment: Development")
367 if build:
381368 remove_build_directory(build_dir)
382
383 # Minify CSS
384369 minify_css(css_src, css_min)
385
386 # Run publishing script (with console output)
387370 run_emacs_publish(dev_mode=True)
388
389 # Update index page with latest posts
390371 update_index_html(html_snippet)
391
392 # Minify index page
393372 minify_html("./.build/index.html", "./.build/index.html")
394
395 # Generate sitemap
396373 generate_sitemap()
397
398 # Launch development web server
374 if deploy:
399375 start_dev_server(build_dir)
400376
401377