Compare commits

...

73 Commits

Author SHA1 Message Date
397159563d Merge pull request 'Add CI' (#1) from testing-ci into main
All checks were successful
Build and deploy / Build (push) Successful in 2m14s
Reviewed-on: #1
2025-11-20 20:28:20 +00:00
Evrard Van Espen
dd1b3accb4 DONE
All checks were successful
Build and deploy / Build (push) Successful in 2m19s
2025-11-20 20:24:33 +00:00
Evrard Van Espen
7968ceed33 DONE
All checks were successful
Build and deploy / Build (push) Successful in 2m20s
2025-11-20 20:20:44 +00:00
Evrard Van Espen
54ffd24610 DONE
All checks were successful
Build and deploy / Build (push) Successful in 1m52s
2025-11-20 20:08:45 +00:00
Evrard Van Espen
ad55d7018d DONE
Some checks failed
Build and deploy / Build (push) Failing after 2m12s
2025-11-20 20:06:28 +00:00
Evrard Van Espen
c696efbac3 DONE
All checks were successful
Build and deploy / Build (push) Successful in 2m7s
2025-11-20 19:56:09 +00:00
Evrard Van Espen
e2eeafacc8 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m13s
2025-11-20 19:50:39 +00:00
Evrard Van Espen
604633fe7f Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m6s
2025-11-20 19:40:15 +00:00
Evrard Van Espen
00da78dd87 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m50s
2025-11-20 19:34:46 +00:00
Evrard Van Espen
bea4784dc6 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m6s
2025-11-20 19:30:46 +00:00
Evrard Van Espen
ce09964bc1 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m5s
2025-11-20 19:11:04 +00:00
Evrard Van Espen
374909497a Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m7s
2025-11-20 19:03:43 +00:00
Evrard Van Espen
1e1f25f3ff Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 32s
2025-11-20 18:57:39 +00:00
Evrard Van Espen
d05ba9903c Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 27s
2025-11-20 18:56:52 +00:00
Evrard Van Espen
4f49fcfa48 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 27s
2025-11-20 18:56:03 +00:00
Evrard Van Espen
e86e7287be Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 28s
2025-11-20 18:55:18 +00:00
Evrard Van Espen
5fb92608d2 Testing 2025-11-20 18:55:08 +00:00
Evrard Van Espen
37cd25db56 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 27s
2025-11-20 18:52:48 +00:00
Evrard Van Espen
6284facd45 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 31s
2025-11-20 18:51:41 +00:00
Evrard Van Espen
0ebdeb5cc2 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 27s
2025-11-20 18:49:55 +00:00
Evrard Van Espen
4f7a7c7445 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 28s
2025-11-20 18:48:06 +00:00
Evrard Van Espen
ab3f36ee41 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 29s
2025-11-20 18:45:59 +00:00
Evrard Van Espen
ab9876b81a Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m41s
2025-11-20 18:38:11 +00:00
Evrard Van Espen
da76380ec1 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m38s
2025-11-20 18:34:26 +00:00
Evrard Van Espen
be2aec45d7 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m38s
2025-11-20 18:28:41 +00:00
Evrard Van Espen
766484a12a Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 32s
2025-11-20 18:25:25 +00:00
Evrard Van Espen
daacb9ad9b Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33s
2025-11-20 18:07:44 +00:00
Evrard Van Espen
37d848325b Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 34s
2025-11-20 18:05:51 +00:00
Evrard Van Espen
597e2bc127 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 24s
2025-11-20 18:04:34 +00:00
Evrard Van Espen
8c243d2ebe Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 33s
2025-11-20 18:02:32 +00:00
Evrard Van Espen
0af26607ec Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 32s
2025-11-20 18:00:10 +00:00
Evrard Van Espen
93adb089f4 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 25s
2025-11-20 17:58:53 +00:00
Evrard Van Espen
eb24f84935 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 26s
2025-11-20 17:57:23 +00:00
Evrard Van Espen
450fc18b1a Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 29s
2025-11-20 17:56:26 +00:00
Evrard Van Espen
576abba4b0 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 21s
2025-11-20 17:54:27 +00:00
Evrard Van Espen
2150568632 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 24s
2025-11-20 17:50:44 +00:00
Evrard Van Espen
bd57b3e5c7 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m15s
2025-11-20 17:45:18 +00:00
Evrard Van Espen
28751fb1d3 Testing
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m5s
2025-11-20 17:41:07 +00:00
Evrard Van Espen
04769dc468 Testing
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 29s
2025-11-20 17:39:24 +00:00
Evrard Van Espen
1b1d2dfa23 Add Dockerfile
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m13s
2025-11-20 17:33:17 +00:00
Evrard Van Espen
c18e477dfc Add Dockerfile
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 2m14s
2025-11-20 13:26:35 +00:00
Evrard Van Espen
9283322dbb Add Dockerfile
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m17s
2025-11-20 13:22:03 +00:00
Evrard Van Espen
669b1ca240 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 49s
2025-11-20 13:21:01 +00:00
Evrard Van Espen
55fef92fa9 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 47s
2025-11-20 13:19:19 +00:00
Evrard Van Espen
dedebb2c36 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 50s
2025-11-20 13:18:09 +00:00
Evrard Van Espen
70c1381e1d Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m57s
2025-11-20 13:15:24 +00:00
Evrard Van Espen
5a09cb629d Update CI
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 59s
2025-11-20 13:12:40 +00:00
Evrard Van Espen
5d0329d6c5 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m31s
2025-11-20 12:58:39 +00:00
Evrard Van Espen
d0ae75c973 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s
2025-11-20 12:57:42 +00:00
Evrard Van Espen
22d1473f29 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m32s
2025-11-20 12:55:40 +00:00
Evrard Van Espen
178b7e3419 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s
2025-11-20 12:52:21 +00:00
Evrard Van Espen
6ccc0f4f3f Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m31s
2025-11-20 12:20:45 +00:00
Evrard Van Espen
95504cb8b9 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 19s
2025-11-20 12:06:17 +00:00
Evrard Van Espen
e626cc9b76 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 3s
2025-11-20 12:05:50 +00:00
Evrard Van Espen
a283e63404 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m43s
2025-11-20 12:02:05 +00:00
Evrard Van Espen
3e2fcc2e09 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-20 11:55:42 +00:00
Evrard Van Espen
22baf098f2 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2m45s
2025-11-20 11:46:29 +00:00
Evrard Van Espen
dd5db92bea Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
2025-11-20 11:46:01 +00:00
Evrard Van Espen
ee517d6aca Update CI
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
2025-11-20 11:21:14 +00:00
Evrard Van Espen
9191c0d50a Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1m8s
2025-11-20 11:19:53 +00:00
Evrard Van Espen
c6403415f4 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 11s
2025-11-20 11:19:21 +00:00
Evrard Van Espen
e00b2b2d33 Update CI
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
2025-11-20 11:17:32 +00:00
Evrard Van Espen
7473910598 Update CI
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s
2025-11-19 17:43:36 +00:00
Evrard Van Espen
26a727fdc0 Update CI 2025-11-19 17:33:03 +00:00
Evrard Van Espen
d2a2034318 Update CI 2025-11-19 17:31:04 +00:00
Evrard Van Espen
628474510a Update CI 2025-11-19 17:30:38 +00:00
Evrard Van Espen
451ccaa5cf Update CI 2025-11-19 17:06:53 +00:00
Evrard Van Espen
37d3f74cbd Update CI 2025-11-19 17:02:35 +00:00
Evrard Van Espen
ecd9198953 Update CI 2025-11-18 10:40:33 +00:00
Evrard Van Espen
e00b158d97 Add ci 2025-11-18 09:40:51 +00:00
Evrard Van Espen
e04f8d6d1f Update todo list 2025-11-18 09:40:27 +00:00
Evrard Van Espen
604468a2ff Add better logging for style processing 2025-11-18 09:40:19 +00:00
Evrard Van Espen
4fafe1254a Add draft support 2025-11-18 09:40:07 +00:00
9 changed files with 161 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
name: Build and deploy
run-name: 🚀
on: [push]
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Login to container registry
uses: https://github.com/docker/login-action@v3
with:
registry: https://git.vanespen.dev
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Build and push
uses: https://github.com/docker/build-push-action@v6
with:
context: .
push: true
pull: true
no-cache: true
tags: "git.vanespen.dev/evanespen/blog:latest"
- name: Setup Kubectl
run: |
mkdir ~/.kube
echo '${{ secrets.KUBECONFIG }}' > ~/.kube/config
export COMMIT_REF=$(git rev-parse HEAD)
echo $COMMIT_REF
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
sed -i "s/COMMIT_REF/$COMMIT_REF/g" argo.template.yaml
/usr/local/bin/kubectl apply --validate=false -f argo.template.yaml

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM archlinux as builder
RUN pacman -Syy \
&& pacman -S --noconfirm go dart-sass icu
COPY . /app
WORKDIR /app
RUN go run .
FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html/
COPY --from=builder /app/build/ /usr/share/nginx/html/
EXPOSE 80

View File

@@ -54,7 +54,7 @@ This is a personal blog built with Go, using the go-org library to parse Org-mod
- [ ] footer
- [ ] resume page
- [ ] contact page
- [ ] responsive
- [X] responsive
- [ ] RSS
- [ ] favicon
- [ ] search

43
argo.template.yaml Normal file
View File

@@ -0,0 +1,43 @@
---
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
name: blog
namespace: argocd
spec:
description: Project for the blog application
sourceRepos:
- https://git.vanespen.dev/evanespen/blog
destinations:
- namespace: blog
server: https://kubernetes.default.svc
clusterResourceWhitelist:
- group: "*"
kind: "*"
namespaceResourceWhitelist:
- group: "*"
kind: "*"
syncWindows: []
roles: []
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: blog-argo
namespace: argocd
spec:
project: blog
source:
repoURL: "https://git.vanespen.dev/evanespen/blog"
targetRevision: COMMIT_REF
path: "k8s"
destination:
server: "https://kubernetes.default.svc"
namespace: blog
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View File

@@ -1,3 +1,4 @@
#!/bin/bash
export BLOG_ENV=dev
watchexec --restart -w ./ --no-process-group -- go run .

View File

@@ -1,3 +1,4 @@
#!/bin/bash
rm -rf build
go run .

47
k8s/deploy.yaml Normal file
View File

@@ -0,0 +1,47 @@
---
apiVersion: v1
kind: Pod
metadata:
name: blog-pod
namespace: blog
labels:
app: blog-pod
spec:
containers:
- name: blog-container
image: git.vanespen.dev/evanespen/blog:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: blog-service
namespace: blog
spec:
selector:
app: blog-pod
ports:
- protocol: TCP
port: 80
targetPort: 80
type: ClusterIP
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: blog-ingressroute
namespace: blog
spec:
entryPoints:
- websecure
routes:
- match: Host(`vanespen.dev`)
kind: Rule
services:
- name: blog-service
port: 80
tls:
certResolver: letsencrypt_dns

View File

@@ -27,6 +27,7 @@ type Post struct {
Content *org.Document // Parsed content of the post
ReadTime uint8 // Estimated reading time in minutes
Hero string // URL path to the hero image for the post
Draft bool // Is the article a draft (will not be rendered if so)
}
// listPosts reads the posts directory and returns a slice of Post structs.
@@ -49,8 +50,14 @@ func listPosts() ([]Post, error) {
if err != nil {
log.Println("[!] Unable to parse ", filePath)
} else {
if post.Draft {
if os.Getenv("BLOG_ENV") == "dev" {
posts = append(posts, post)
}
} else {
posts = append(posts, post)
}
}
}
sort.Slice(posts, func(i, j int) bool {
@@ -103,6 +110,10 @@ func parseOrg(filePath string) (Post, error) {
slug := orgData.Get("SLUG")
tags := strings.Split(orgData.Get("TAGS"), ", ")
hero := path.Join("/medias", orgData.Get("HERO"))
draft := true
if orgData.Get("DRAFT") == "false" {
draft = false
}
date, _ := time.Parse("2006-01-02", dateStr)
ts := date.Unix()
@@ -123,5 +134,6 @@ func parseOrg(filePath string) (Post, error) {
Content: orgData,
ReadTime: uint8(readTime),
Hero: hero,
Draft: draft,
}, nil
}

View File

@@ -48,13 +48,13 @@ func compileSCSS() (string, error) {
transpiler, err := godartsass.Start(godartsass.Options{})
if err != nil {
log.Fatal(err)
log.Fatal("cannot start transpiler: ", err)
}
css, err := transpiler.Execute(args)
if err != nil {
log.Fatal(err)
log.Fatal("cannot compile SCSS: ", err)
}
log.Println("CSS compiled")