From 4bf4c0f6397de55413abec5ba62ea57c3a27aedf Mon Sep 17 00:00:00 2001 From: Julia McGhee Date: Sat, 21 Mar 2026 17:51:14 +0000 Subject: [PATCH] Fix pnpm cache: use inline export instead of workflow env block act_runner v0.3.0 doesn't propagate workflow-level or job-level env: blocks to job containers. Use export in run commands instead. First run warms cache, subsequent runs will show reused packages. --- .gitea/workflows/ci.yaml | 27 ++++++++++++++++--------- .gitea/workflows/deploy-preview.yaml | 18 ++++++++--------- .gitea/workflows/deploy-production.yaml | 14 +++++++------ 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 5ad0f1c..0166e61 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -10,21 +10,24 @@ concurrency: group: ${{ gitea.workflow }}-${{ gitea.ref }} cancel-in-progress: true -env: - PNPM_STORE_DIR: /pnpm-store - COREPACK_HOME: /pnpm-store/.corepack - jobs: lint-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: corepack enable && corepack prepare pnpm@latest --activate + - name: Setup pnpm + run: | + export COREPACK_HOME=/pnpm-store/.corepack + corepack enable && corepack prepare pnpm@latest --activate - - run: pnpm install --frozen-lockfile + - name: Install dependencies + run: | + export PNPM_STORE_DIR=/pnpm-store + pnpm install --frozen-lockfile - - run: pnpm turbo lint test + - name: Lint and test + run: pnpm turbo lint test build: needs: [lint-and-test] @@ -34,9 +37,15 @@ jobs: with: fetch-depth: 0 - - run: corepack enable && corepack prepare pnpm@latest --activate + - name: Setup pnpm + run: | + export COREPACK_HOME=/pnpm-store/.corepack + corepack enable && corepack prepare pnpm@latest --activate - - run: pnpm install --frozen-lockfile + - name: Install dependencies + run: | + export PNPM_STORE_DIR=/pnpm-store + pnpm install --frozen-lockfile - name: Detect and build changed apps run: | diff --git a/.gitea/workflows/deploy-preview.yaml b/.gitea/workflows/deploy-preview.yaml index 7273360..c08816b 100644 --- a/.gitea/workflows/deploy-preview.yaml +++ b/.gitea/workflows/deploy-preview.yaml @@ -4,19 +4,21 @@ on: pull_request: types: [opened, synchronize, reopened] -env: - PNPM_STORE_DIR: /pnpm-store - COREPACK_HOME: /pnpm-store/.corepack - jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: corepack enable && corepack prepare pnpm@latest --activate + - name: Setup pnpm + run: | + export COREPACK_HOME=/pnpm-store/.corepack + corepack enable && corepack prepare pnpm@latest --activate - - run: pnpm install --frozen-lockfile + - name: Install dependencies + run: | + export PNPM_STORE_DIR=/pnpm-store + pnpm install --frozen-lockfile - name: Determine changed apps id: changes @@ -47,11 +49,9 @@ jobs: done - name: Comment preview URL - env: - GITEA_TOKEN: ${{ gitea.token }} run: | curl -s -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Authorization: token ${{ gitea.token }}" \ -H "Content-Type: application/json" \ -d "{\"body\": \"## Preview Deploy\nNamespace: \`preview-${{ gitea.event.number }}\`\nArgoCD will sync automatically.\"}" \ "${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.number }}/comments" diff --git a/.gitea/workflows/deploy-production.yaml b/.gitea/workflows/deploy-production.yaml index ec7c3a2..f81832d 100644 --- a/.gitea/workflows/deploy-production.yaml +++ b/.gitea/workflows/deploy-production.yaml @@ -10,10 +10,6 @@ on: required: false default: "" -env: - PNPM_STORE_DIR: /pnpm-store - COREPACK_HOME: /pnpm-store/.corepack - jobs: deploy: runs-on: ubuntu-latest @@ -22,9 +18,15 @@ jobs: with: fetch-depth: 2 - - run: corepack enable && corepack prepare pnpm@latest --activate + - name: Setup pnpm + run: | + export COREPACK_HOME=/pnpm-store/.corepack + corepack enable && corepack prepare pnpm@latest --activate - - run: pnpm install --frozen-lockfile + - name: Install dependencies + run: | + export PNPM_STORE_DIR=/pnpm-store + pnpm install --frozen-lockfile - name: Determine changed apps id: changes