Skip to content

More descriptive name #2

More descriptive name

More descriptive name #2

Workflow file for this run

name: Build Image
on: push
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
# TODO: use OIDC for auth:
# https://github.com/aws-actions/configure-aws-credentials#assuming-a-role
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push docker image to Amazon ECR
uses: docker/build-push-action@v4
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: dse-infra-dev-us-west-2-default
IMAGE_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'test' }}
with:
push: true
context: "."
file: "./images/Dockerfile"
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}