Skip to content

build(deps): bump aws-actions/amazon-ecr-login from 1 to 2 (#197) #28

build(deps): bump aws-actions/amazon-ecr-login from 1 to 2 (#197)

build(deps): bump aws-actions/amazon-ecr-login from 1 to 2 (#197) #28

name: Build and Push Docker Images
on:
push:
branches:
- master
jobs:
push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python_version: '3.8'
docker_tag: latest
- python_version: '3.11'
docker_tag: '3.11'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.TOOLS_EDX_ECR_USER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.TOOLS_EDX_ECR_USER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Log in to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: openedx-codejail
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:${{ matrix.docker_tag }} --build-arg ${{ matrix.python_version }} .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:${{ matrix.docker_tag }}