From d779d24be440d2af11c7925c03488d0cd222c286 Mon Sep 17 00:00:00 2001 From: jakobmoellerdev Date: Fri, 29 Nov 2024 19:23:35 +0100 Subject: [PATCH] fix: allow cache push through PAT --- .github/workflows/components.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/components.yaml b/.github/workflows/components.yaml index 9cf04be0c3..bb623ef213 100644 --- a/.github/workflows/components.yaml +++ b/.github/workflows/components.yaml @@ -33,7 +33,8 @@ env: components: '["ocmcli", "helminstaller", "helmdemo", "subchartsdemo", "ecrplugin"]' IMAGE_PLATFORMS: 'linux/amd64 linux/arm64' PLATFORMS: 'windows/amd64 darwin/arm64 darwin/amd64 linux/amd64 linux/arm64' - BUILDX_CACHE_PUSH: ${{ github.ref == 'refs/heads/main' }} + BUILDX_CACHE_PUSH: true +# BUILDX_CACHE_PUSH: ${{ github.ref == 'refs/heads/main' }} BUILDX_CACHE_REF_BASE: ghcr.io/${{ github.repository }}/buildx-cache jobs: @@ -70,12 +71,18 @@ jobs: cache: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Generate token + id: generate_token + uses: tibdex/github-app-token@v2 + with: # OCMBot + app_id: ${{ secrets.OCMBOT_APP_ID }} + private_key: ${{ secrets.OCMBOT_PRIV_KEY }} - name: Docker Login uses: docker/login-action@v3 with: registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: OCMBot + password: ${{ steps.generate_token.outputs.token }} - name: Get go environment for use with cache run: | echo "go_cache=$(go env GOCACHE)" >> $GITHUB_ENV