From 53f4979ab7dea4339c05bfede5cd824d5d38c5f1 Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@fossgalaxy.com>
Date: Tue, 14 Jan 2025 20:33:15 +0000
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..287adbb
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,42 @@
+variables:
+  DART_SASS_VERSION: 1.81.1
+  GIT_DEPTH: 0
+  GIT_STRATEGY: clone
+  GIT_SUBMODULE_STRATEGY: recursive
+  HUGO_VERSION: 0.140.2
+  NODE_VERSION: 23.x
+  TZ: America/Los_Angeles
+image:
+  name: golang:1.23.4-bookworm
+
+pages:
+  script:
+    # Install brotli
+    - apt-get update
+    - apt-get install -y brotli
+    # Install Dart Sass
+    - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
+    - tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
+    - cp -r dart-sass/ /usr/local/bin
+    - rm -rf dart-sass*
+    - export PATH=/usr/local/bin/dart-sass:$PATH
+    # Install Hugo
+    - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
+    - apt-get install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
+    - rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
+    # Install Node.js
+    - curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
+    - apt-get install -y nodejs
+    # Install Node.js dependencies
+    - "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
+    # Build
+    - hugo --gc --minify --baseURL ${CI_PAGES_URL}
+    # Compress
+    - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec gzip -f -k {} \;
+    - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec brotli -f -k {} \;
+  artifacts:
+    paths:
+      - public
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+
-- 
GitLab