From 5cfff3990a5d8c4047ecbe13d4d55797228c8716 Mon Sep 17 00:00:00 2001 From: rock Date: Sat, 5 Sep 2026 22:41:32 -0700 Subject: [PATCH] ci: simplify workflow - use current directory (repo auto-checked-out) Previous failure: git clone tried to clone into /workspace which already exists Fix: - Remove git clone step - Forgejo automatically checks out repo into current directory - Just install git, get commit info, build, and push - Much simpler and cleaner --- .gitea/workflows/build.yaml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 5280dc3..a6e55d7 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -13,19 +13,15 @@ jobs: image: docker:27-dind options: --privileged steps: - - name: Checkout code + - name: Install git run: | apk add --no-cache git - git clone https://git.riotpiao.com:2222/rock/poimen-memory.git /workspace - cd /workspace - git checkout ${{ github.sha }} - name: Get commit info id: info run: | - cd /workspace - SHORT_SHA=$(git rev-parse --short HEAD) - COMMIT_MSG=$(git log -1 --pretty=%B | head -1) + SHORT_SHA=$(git -C . rev-parse --short HEAD) + COMMIT_MSG=$(git -C . log -1 --pretty=%B | head -1) echo "short_sha=${SHORT_SHA}" >> $GITHUB_OUTPUT echo "commit_msg=${COMMIT_MSG}" >> $GITHUB_OUTPUT echo "Building: ${SHORT_SHA} - ${COMMIT_MSG}" @@ -37,7 +33,6 @@ jobs: - name: Build image run: | - cd /workspace docker build \ --tag forgejo.riotpiao.com/rock/poimen-memory:${{ steps.info.outputs.short_sha }} \ --tag forgejo.riotpiao.com/rock/poimen-memory:latest \