Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Evanjt1 @jhebb @aflesher @sandbender
42 changes: 42 additions & 0 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build-publish-image
description: Build and publish Docker image to ECR
inputs:
repository:
description: 'ECR repository name'
required: true
repo_token:
description: 'Github token'
required: true
dockerfile:
description: 'Dockerfile file name'
required: true
runs:
using: 'composite'
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::559476808817:role/GithubActionsECRRole
aws-region: us-east-1

- name: Login to AWS ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push image to AWS ECR
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.repo_token }}
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: ${{ inputs.repository }}
IMAGE_TAG: ${{ github.run_number }}
DOCKER_FILE: ${{ inputs.dockerfile }}
run: |
docker build -f ${DOCKER_FILE} --build-arg GITHUB_TOKEN="${GITHUB_TOKEN}" -t $REGISTRY/$REPOSITORY:$IMAGE_TAG .
docker tag $REGISTRY/$REPOSITORY:$IMAGE_TAG $REGISTRY/$REPOSITORY:latest
echo "Pushing images to ECR..."
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:latest
24 changes: 24 additions & 0 deletions .github/workflows/build-publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: build-images
run-name: Build client-as image and push to ECR
on:
workflow_dispatch:
push:
branches:
- main

jobs:
build:
name: Build main image and push to ECR
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: read
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/build-publish-image
with:
repository: client-as
repo_token: ${{ secrets.TP_BUILDER_REPO_TOKEN }}
dockerfile: Dockerfile