From 9483e897d3dd58fdde660936a9e4150d1816be93 Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Sat, 1 Jun 2024 13:18:45 +0300
Subject: [PATCH] chore: Create publich ci
Signed-off-by: Awiteb
---
.forgejo/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 .forgejo/workflows/ci.yml
diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml
new file mode 100644
index 0000000..9af402c
--- /dev/null
+++ b/.forgejo/workflows/ci.yml
@@ -0,0 +1,33 @@
+name: Build site
+
+on:
+ push:
+ branches: [master]
+ pull_request:
+ branches: [master]
+
+jobs:
+ build_ci:
+ name: Rust CI
+ runs-on: debian
+ steps:
+ - uses: actions/checkout@v4
+ - name: Build the site
+ run: |
+ curl -s -L https://github.com/getzola/zola/releases/download/v0.18.0/zola-v0.18.0-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C .
+ ./zola build
+ - name: Publish the site
+ run: |
+ cd public
+ git init
+ git checkout -B site
+ git config user.name forgejo-actions
+ git config user.email forgejo-actions@noreply.localhost
+ URL=$(echo $GITHUB_SERVER_URL | sed -E 's/^\s*.*:\/\///g')
+ # Http and not https because the request is inside the instance network
+ git remote add origin http://forgejo-actions:$GITHUB_TOKEN@$URL/$GITHUB_REPOSITORY.git
+ echo "otmp.4rs.nl" > CNAME
+ touch .nojekyll
+ git add .
+ git commit -m "Deploy site"
+ git push --set-upstream origin site -f