Skip to content

Commit

Permalink
Merge pull request #249 from Marukome0743/pr249
Browse files Browse the repository at this point in the history
♻️ci: use github actions cache
  • Loading branch information
Marukome0743 authored Apr 19, 2024
2 parents d63e12c + f590499 commit aa79d78
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,28 @@ 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
with:
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'
Expand Down

0 comments on commit aa79d78

Please sign in to comment.