From 11e8e1355ab8d63bbc1d1a69604e4fc03dc3e76b Mon Sep 17 00:00:00 2001 From: nevaforget Date: Fri, 24 Apr 2026 09:08:49 +0200 Subject: [PATCH] ci(build): persist cargo registry via CARGO_HOME on existing volume MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compose mount `./runner-cargo-target:/cache/target` already persists the target dir. Set CARGO_HOME to a subdir of that mount so the downloaded-crates index + git cache survive too — otherwise every build re-fetches every dep. No server-side compose change needed. --- .gitea/workflows/build-and-publish.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitea/workflows/build-and-publish.yaml b/.gitea/workflows/build-and-publish.yaml index 1db2cb7..8674c33 100644 --- a/.gitea/workflows/build-and-publish.yaml +++ b/.gitea/workflows/build-and-publish.yaml @@ -16,6 +16,13 @@ jobs: steps: - name: Build and publish changed packages run: | + # Persist cargo registry + git cache across runs by piggy-backing + # on the existing persistent CARGO_TARGET_DIR volume (compose + # mounts ./runner-cargo-target -> /cache/target). Without this, + # every build re-downloads every crate. + export CARGO_HOME="${CARGO_TARGET_DIR:-/cache/target}/cargo-home" + mkdir -p "$CARGO_HOME" + rm -rf repo git clone http://gitea:3000/nevaforget/moonarch-pkgbuilds.git repo cd repo