Add CI
Some checks failed
Build and Release Site / builder (push) Successful in 3m41s
Build and Release Site / release (push) Failing after 22s

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-09-14 18:39:22 +01:00
parent 74873651a8
commit 913f31ba2a
3 changed files with 66 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -1,3 +1,4 @@
*.webp filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text

6
.gitea/Containerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM ghcr.io/catthehacker/ubuntu:act-latest
RUN HUGO_VERSION=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name') \
&& curl -L -o /tmp/hugo.tar.gz "https://github.com/gohugoio/hugo/releases/download/${HUGO_VERSION}/hugo_extended_${HUGO_VERSION#v}_Linux-64bit.tar.gz" \
&& tar -xzf /tmp/hugo.tar.gz -C /usr/local/bin hugo \
&& rm /tmp/hugo.tar.gz

View File

@@ -0,0 +1,59 @@
name: Build and Release Site
on:
push:
branches:
- "**"
jobs:
builder:
uses: karaolidis/workflows/.gitea/workflows/builder.yaml@main
with:
registry: git.karaolidis.com
username: ${{ github.repository_owner }}
secrets:
password: ${{ secrets.REGISTRY_PASSWORD }}
release:
runs-on: nix
needs: builder
container:
image: ${{ needs.builder.outputs.tag }}
steps:
- name: Configure submodule authentication
run: |
git config --global url."https://${{ github.repository_owner }}:${{ secrets.LFS_TOKEN }}@git.karaolidis.com/".insteadOf "https://git.karaolidis.com/"
- name: Checkout
uses: actions/checkout@v3
with:
lfs: true
submodules: recursive
- name: Build Site
run: |
cd themes/caldwell
npm install
cd ../..
ln -s ./themes/caldwell/node_modules node_modules
hugo --config hugo.toml --minify
- name: Package Site
run: |
tar -czf site.tar.gz -C public .
- name: Release
uses: https://github.com/akkuman/gitea-release-action@main
with:
name: "Release ${{ github.sha }}"
tag_name: "release-${{ github.sha }}"
files: site.tar.gz
- name: Publish
env:
TARGET_URL: https://blog.karaolidis.com/upload
run: |
curl -X POST "$TARGET_URL" \
-H "Authorization: ${{ secrets.BLOG_API_KEY }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @site.tar.gz