Skip to content

Commit

Permalink
Add generic docker push action
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon committed Nov 15, 2022
1 parent 1533bff commit 4537c53
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docker/build-push/action.yml
@@ -0,0 +1,46 @@
name: Build Docker Image and push to ECR
description: Common docker image builder for building chainlink docker images
inputs:
tags:
required: true
description: The full docker tag to use for the push to ecr, comma separated for multiple, example latest,develop,...
file:
required: true
description: The path to the dockerfile to build
build-args:
required: false
description: Comma separated build-args for the docker build to pass through, example KEY1=VAL1,KEY2=VAL2,...
push:
required: true
default: "true"
description: Whether we should push the image or not
AWS_REGION:
required: true
description: The AWS region to use
AWS_ROLE_TO_ASSUME:
required: true
description: The AWS role to assume

runs:
using: composite
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: ${{ inputs.AWS_REGION }}
role-to-assume: ${{ inputs.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and Push
uses: docker/build-push-action@v3
id: build-image
with:
context: .
file: ${{ inputs.file }}
build-args: ${{ inputs.build-args }}
tags: ${{ inputs.tags }}
push: ${{ inputs.push }}

0 comments on commit 4537c53

Please sign in to comment.