From f590499cfaf3a45001ba108f5f3a86545e067cdf Mon Sep 17 00:00:00 2001 From: Marukome0743 Date: Fri, 19 Apr 2024 16:01:03 +0900 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8Fci:=20use=20github=20actions?= =?UTF-8?q?=20cache?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push-image.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/push-image.yml b/.github/workflows/push-image.yml index 4bf25f3..8ad4c77 100644 --- a/.github/workflows/push-image.yml +++ b/.github/workflows/push-image.yml @@ -95,6 +95,8 @@ jobs: type=ref,event=tag type=ref,event=pr,prefix=pr- type=raw,value=canary,enable=${{ env.IS_PUSH }} + env: + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index - name: Build and Push uses: docker/build-push-action@v5 @@ -102,18 +104,19 @@ jobs: context: . platforms: ${{ env.IS_PUSH && 'linux/amd64,linux/arm64' || 'linux/amd64' }} push: ${{ env.IS_PUSH }} + load: ${{ !env.IS_PUSH }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REPOSITORY }}:canary - cache-to: type=inline - outputs: ${{ github.event_name == 'push' && 'type=image,name=target,annotation-index.org.opencontainers.image.description=homepage multi-arch image' || 'type=docker' }} + annotations: ${{ steps.meta.outputs.annotations }} + cache-from: type=gha + cache-to: type=gha,mode=max provenance: false - - name: Update AWS Lambda Function - if: env.IS_PUSH - run: | - aws lambda update-function-code --function-name ${{ env.LAMBDA_FUNCTION_NAME }} \ - --image-uri ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ steps.meta.outputs.version }} + # - name: Update AWS Lambda Function + # if: env.IS_PUSH + # run: | + # aws lambda update-function-code --function-name ${{ env.LAMBDA_FUNCTION_NAME }} \ + # --image-uri ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ steps.meta.outputs.version }} - name: Docker Scout if: github.repository_owner == 'OpenUp-LabTakizawa' && github.event_name == 'pull_request_target'