Merge pull request #357 from Contrast-Security-OSS/NODE-3651-express5 #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [express4,express5,fastify3,fastify4,koa,hapi20,hapi21] | |
version: [16, 18, 20, 22] | |
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 |