diff --git a/.github/actions/setup-pnpm/action.yml b/.github/actions/setup-pnpm/action.yml index f93e3405..f0813da8 100644 --- a/.github/actions/setup-pnpm/action.yml +++ b/.github/actions/setup-pnpm/action.yml @@ -1,35 +1,38 @@ name: "Setup pnpm" -description: "Sets up pnpm with caching" +description: "Sets up pnpm with caching and installation" runs: using: composite steps: - - name: Extract pnpm version from .tool-versions - id: pnpm-version + - name: Extract versions from .tool-versions + id: versions shell: bash run: | PNPM_VERSION=$(grep 'pnpm' .tool-versions | awk '{print $2}') - echo "Using pnpm version: $PNPM_VERSION" - echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT + NODE_VERSION=$(grep 'nodejs' .tool-versions | awk '{print $2}') + echo "pnpm=$PNPM_VERSION" >> $GITHUB_OUTPUT + echo "node=$NODE_VERSION" >> $GITHUB_OUTPUT - name: Setup pnpm uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4 with: - version: ${{ steps.pnpm-version.outputs.version }} + version: ${{ steps.versions.outputs.pnpm }} - name: Get pnpm store directory shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - name: Restore pnpm cache uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4 with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + path: | + ${{ env.STORE_PATH }} + node_modules + .pnpm-store + key: ${{ runner.os }}-node-${{ steps.versions.outputs.node }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-pnpm- + ${{ runner.os }}-node-${{ steps.versions.outputs.node }}-pnpm- - name: Install dependencies shell: bash - run: pnpm install + run: pnpm install --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0b107e0..afc23668 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,9 +56,6 @@ jobs: # Set up Docker Buildx - name: Set up Docker Buildx uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 - with: - driver-opts: | - image=moby/buildkit:v0.12.0 # Login to GitHub Container Registry - name: Login to GitHub Container Registry uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 @@ -88,8 +85,13 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + platforms: linux/amd64,linux/arm64 + cache-from: | + type=gha,scope=${{ github.ref_name }}-${{ github.job }} + type=registry,ref=ghcr.io/${{ github.repository }}:buildcache + cache-to: | + type=gha,mode=max,scope=${{ github.ref_name }}-${{ github.job }} + type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max summary: name: Workflow Summary