From 8df16fa9750f306762b21ed893c67bc5394221df Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Tue, 21 Nov 2023 16:38:06 +0000 Subject: [PATCH] support go mod cache --- .github/workflows/build-test.yaml | 4 ++++ deploy/melange.yaml.tmpl | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index a5ffc8931c..167674bdb4 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -296,12 +296,16 @@ jobs: # --signing-key ${{ github.workspace }}/melange.rsa \ # --cache-dir "$(go env GOMODCACHE)" + - id: cache-dir + run: echo "cache_dir=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + # - uses: chainguard-dev/actions/melange-build@main - uses: sgalsaleh/chainguard-dev-actions/melange-build@4824ef7293e21e9d66749bd24cfd2a11f9d05dfa with: config: deploy/melange.yaml archs: x86_64 sign-with-temporary-key: true + cache-dir: ${{ steps.cache-dir.outputs.cache_dir }} - uses: chainguard-images/actions/apko-publish@main with: diff --git a/deploy/melange.yaml.tmpl b/deploy/melange.yaml.tmpl index e72b4f3d14..d2a2ad7523 100644 --- a/deploy/melange.yaml.tmpl +++ b/deploy/melange.yaml.tmpl @@ -19,6 +19,8 @@ environment: - go - nodejs - yarn + environment: + GOMODCACHE: '/var/cache/melange' pipeline: - runs: |