Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ci: use github actions cache #249

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading