cmc/cleberg.net

My personal web garden & blog.

clone: git clone https://gitbay.org/cmc/cleberg.net.git

c5ddea05b5421a0abd549406f300dc5e3968e3c5

verified · cmc

author: Christian Cleberg <hello@cleberg.net> · 2026-03-23T15:48:47Z

publish Domain Dig link
 .builds/deploy.yml           | 34 ++++++++++++++++++++++++++++++++
 .github/dependabot.yml       |  6 ------
 .github/workflows/codeql.yml | 46 --------------------------------------------
 build.py                     | 11 +++++++++++
 4 files changed, 45 insertions(+), 52 deletions(-)

diff --git a/.builds/deploy.yml b/.builds/deploy.yml
new file mode 100644
index 0000000..62588ae
--- /dev/null
+++ b/.builds/deploy.yml
@@ -0,0 +1,34 @@
+image: debian/bookworm
+
+packages:
+  - emacs-nox
+  - python3
+  - python3-pip
+  - rsync
+  - openssh-client
+
+sources:
+  - https://git.sr.ht/~ccleberg/cleberg.net
+
+secrets:
+  - <ssh-deploy-key-uuid>   # ~/.ssh/id_rsa, has write access to server
+
+environment:
+  ENV: prod
+  BUILD: "true"
+
+tasks:
+  - setup: |
+      pip install --break-system-packages uv
+      curl -sSfL https://github.com/tdewolff/minify/releases/latest/download/minify_linux_amd64.tar.gz \
+        | tar -xz -C ~/.local/bin minify
+  - build: |
+      cd cleberg.net
+      uv run build.py
+  - deploy: |
+      cd cleberg.net
+      chmod 600 ~/.ssh/id_rsa
+      rsync -r --delete-before \
+        -e "ssh -o StrictHostKeyChecking=no" \
+        .build/ \
+        homelab:/var/www/cleberg.net/
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 6483b1d..0000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-version: 2
-updates:
-  - package-ecosystem: "uv"
-    directory: "/"
-    schedule:
-      interval: "weekly"
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
deleted file mode 100644
index f857dda..0000000
--- a/.github/workflows/codeql.yml
+++ /dev/null
@@ -1,46 +0,0 @@
-name: "CodeQL Advanced"
-
-on:
-  push:
-    branches: [ "main" ]
-  pull_request:
-    branches: [ "main" ]
-
-jobs:
-  analyze:
-    name: Analyze (${{ matrix.language }})
-    runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
-    permissions:
-      security-events: write
-      packages: read
-      actions: read
-      contents: read
-
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-        - language: python
-          build-mode: none
-    steps:
-    - name: Checkout repository
-      uses: actions/checkout@v4
-    - name: Initialize CodeQL
-      uses: github/codeql-action/init@v4
-      with:
-        languages: ${{ matrix.language }}
-        build-mode: ${{ matrix.build-mode }}
-    - if: matrix.build-mode == 'manual'
-      shell: bash
-      run: |
-        echo 'If you are using a "manual" build mode for one or more of the' \
-          'languages you are analyzing, replace this with the commands to build' \
-          'your code, for example:'
-        echo '  make bootstrap'
-        echo '  make release'
-        exit 1
-
-    - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v4
-      with:
-        category: "/language:${{matrix.language}}"
diff --git a/build.py b/build.py
index b3e04a4..f109ce3 100644
--- a/build.py
+++ b/build.py
@@ -34,6 +34,16 @@ from datetime import datetime
 from pathlib import Path
 
 
+def run_ruff():
+    print("Running ruff...")
+    for cmd in [["ruff", "check", "--fix"], ["ruff", "format"]]:
+        result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
+        if result.returncode != 0:
+            print(f"ruff error ({' '.join(cmd)}):")
+            print(result.stderr, file=sys.stderr)
+            sys.exit(1)
+
+
 def update_index_html(html_snippet, template_path="./.build/index.html"):
     """
     Read the index.html file at `template_path`, replace everything between
@@ -558,6 +568,7 @@ def start_dev_server(build_dir):
 
 
 def main():
+    run_ruff()
     html_snippet = get_recent_posts_html("./content/blog", num_posts=3)
 
     build_dir = Path(".build")