From 48a2987ec50c75b13d3e7872d6df7ae1e71f189c Mon Sep 17 00:00:00 2001 From: Jean-Michel Tremblay Date: Thu, 23 Apr 2026 17:11:39 -0400 Subject: [PATCH] fuck with builds --- .forgejo/workflows/build.yml | 48 ++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index cdee565..0251b46 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -12,25 +12,59 @@ jobs: run: | mkdir -p site/public chmod 777 site + # - name: Build + # run: | + # mkdir -p "$PWD/.hugo-cache" + # docker run --rm \ + # -u "$(id -u):$(id -g)" \ + # -v "$PWD/site:/src" \ + # -v "$PWD/.git:/src/.git:ro" \ + # -v "$PWD/.hugo-cache:/cache" \ + # -e GOPATH=/cache \ + # -w /src \ + # forgejo.jmopines.com/jm/hugo-git:latest \ + # --minify --destination "public" --baseURL "/" + # - name: Deploy + # run: | + # echo "${{ secrets.FORGEJO_SSH }}" > /tmp/deploy_key + # chmod 600 /tmp/deploy_key + # rsync -az --delete \ + # --exclude 'resume/' \ + # -e "ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no" \ + # site/public/. \ + # ${{ vars.JMOPINES_USER }}@${{ vars.JMOPINES_IP }}:/var/www/jmopines/ + # rm /tmp/deploy_key - name: Build run: | + set -ex + # 1. Ensure the cache exists mkdir -p "$PWD/.hugo-cache" + + # 2. Run Hugo + # We mount the WHOLE root ($PWD) so Hugo sees the .git folder + # We set the working directory to /src/site where your hugo files live docker run --rm \ - -u "$(id -u):$(id -g)" \ - -v "$PWD/site:/src" \ - -v "$PWD/.git:/src/.git:ro" \ + -v "$PWD:/src" \ -v "$PWD/.hugo-cache:/cache" \ -e GOPATH=/cache \ - -w /src \ + -w /src/site \ forgejo.jmopines.com/jm/hugo-git:latest \ - --minify --destination "public" --baseURL "/" + hugo --minify --enableGitInfo --destination "public" --baseURL "/" - name: Deploy run: | + set -ex + # Verify files exist + ls -la site/public/ + + # Setup SSH echo "${{ secrets.FORGEJO_SSH }}" > /tmp/deploy_key chmod 600 /tmp/deploy_key - rsync -az --delete \ + + # Sync with verbose output so we see what is happening + rsync -avz --delete \ --exclude 'resume/' \ -e "ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no" \ - site/public/. \ + site/public/ \ ${{ vars.JMOPINES_USER }}@${{ vars.JMOPINES_IP }}:/var/www/jmopines/ + rm /tmp/deploy_key \ No newline at end of file