]> git.frustrated-labs.net Git - frustrated-functor.dev.git/commitdiff
add build script for CI
authorAlexander Goussas <[email protected]>
Thu, 30 Apr 2026 17:40:59 +0000 (12:40 -0500)
committerAlexander Goussas <[email protected]>
Thu, 30 Apr 2026 17:40:59 +0000 (12:40 -0500)
.gitignore
bin/blog-processor/src/html_formatter.zig
public/2026-04-19-one-of-the-best-skills-ive-learned-as-a-programmer.md.html [deleted file]
scripts/build.sh [new file with mode: 0755]

index 880cd5d2e2be68cdef4a73cb595b9b46f8e73e21..eb93b3fc1a0b079afb6f7449df9041ff203f977a 100644 (file)
@@ -1,2 +1,3 @@
 zig-out
 .zig-cache
+public/*.html
index c3b6c96da58691efd7551915598a3932c1599f40..fd9ffb9ce2d9db7fbd6750f374a4e0cc52d0aa57 100644 (file)
@@ -2,10 +2,6 @@ const std = @import("std");
 const md = @import("./markdown_parser.zig");
 const strings = @import("./string_utils.zig");
 
-const stdC = @cImport({
-    @cInclude("stdio.h");
-});
-
 pub const Options = struct {
     template: ?[]const u8, 
 };
diff --git a/public/2026-04-19-one-of-the-best-skills-ive-learned-as-a-programmer.md.html b/public/2026-04-19-one-of-the-best-skills-ive-learned-as-a-programmer.md.html
deleted file mode 100644 (file)
index dcea1a3..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <meta charset="UTF-8">
-  <title>Alexander Goussas</title>
-  <meta name="viewport" content="width=device-width,initial-scale=1">
-  <link rel="stylesheet" href="styles.css">
-  <script src=""></script>
-  <body>
-    <div class="">
-      <h1>One of the best Skills I've learned as a Programmer</h1>
-      <div>
-        <span>Last updated: 19 april 2026</span>
-      </div>
-      <p>There are many different skills one might invest it when getting into programming.
-There is a plethora of programming languages, each with their unique appeal.
-And within each language ecosystem, a plethora of web frameworks and stuff to learn.</p>
-<p>But for me, one of the greatest investments came from something else altogether:
-learning how to touch type.</p>
-<p>For those of you that don't know, touch typing basically means typing without
-looking at your keyboard. But I include in the definition typing with all your 
-fingers.</p>
-<p>Before learning to touch type, I only used both my index fingers. I literally did 
-not use any other finger. One day, I decided to change that and started dedicating
-a lot of time to acquiring the ability to touch type.</p>
-<p>There was a free website I used for this, whose name I have since forgotten.
-Something like typingrace of something like that.</p>
-<p>Anywho, today, I can write at ~120 WPM, which is not a crazy speed, but pretty
-respectable, if I may say so myself. Sometimes I just like typing whatever to feel
-the vertigo as my fingers speed through my keyboard.</p>
-<p>Also, this is a transferable skill, so if you can't touch type yet, I encourage you
-to.
-</p>
-    </div>
-  </body>
-</html>
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755 (executable)
index 0000000..20c1d67
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash 
+
+set -e
+
+POSTS="$(realpath ./posts)"
+EXE='bin/blog-processor/zig-out/bin/blog_processor'
+WORKDIR="$(pwd)"
+REPO='aloussase69/site'
+TAG="$(git describe --tags)"
+IMAGE="$REPO:$TAG"
+
+echo '[INFO] Building blog processor'
+cd bin/blog-processor && zig build && cd "$WORKDIR"
+
+if [ ! -f "$EXE" ]; then
+  echo '[ERROR] Could not locate blog processor'
+  exit 1
+fi
+
+echo '[INFO] Processing blog'
+"$EXE" "$POSTS"
+
+if [ $? -ne 0 ]; then
+  echo '[ERROR] Failed to build posts'
+  exit 1
+fi
+
+echo "[INFO] Building docker image $IMAGE"
+docker build -t "$IMAGE" --push .
+
+echo "[INFO] Aliasing $IMAGE to $REPO:latest"
+docker tag "$IMAGE" "$REPO:latest"
+docker push "$REPO:latest"
+
+exit 0