Skip to content

Update Dockerfile

Update Dockerfile #68

name: ECR Push v5
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
# not all apps support node versions below, but at the very
# least they all build
apps: [express,fastify3,fastify4,koa,hapi20]
version: [14, 16, 18, 20]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push image ${{ matrix.apps }} version ${{ matrix.version }} to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
APP_FOLDER: ${{ matrix.apps }}
ECR_REPOSITORY: ${{ matrix.apps }}-screener
NODE_VERSION: ${{ matrix.version }}
run: |
cd $APP_FOLDER
../scripts/copy-scripts.sh
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:latest-$NODE_VERSION --build-arg node_version=$NODE_VERSION -f ./Dockerfile-screener .
docker push -a $ECR_REGISTRY/$ECR_REPOSITORY