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

QA-138 Part 1 Add generic docker push action #51

Merged
merged 1 commit into from Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
@@ -1,2 +1,3 @@
# chainlink-testing-framework
/chainlink-testing-framework/ @tateexon @kalverra @skudasov @anieeG
/chainlink-testing-framework/ @tateexon @kalverra @skudasov @anieeG @gheorghestrimtu
/docker/ @tateexon @kalverra @skudasov @anieeG @gheorghestrimtu
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 }}