Skip to content

Commit

Permalink
Merge pull request #4 from romiras/aws-ecr
Browse files Browse the repository at this point in the history
CircleCI: publish Docker image to AWS ECR
  • Loading branch information
romiras authored Nov 28, 2021
2 parents 6f94320 + d209824 commit ba325e1
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ version: 2.1
# See: https://circleci.com/docs/2.0/orb-intro/
orbs:
node: circleci/node@4.7
aws-ecr: circleci/aws-ecr@7.3.0

#############################################################
# Parameters
#############################################################
parameters:
repo:
type: string
default: "nodejs-playground"

jobs:
node-test:
Expand All @@ -28,15 +37,26 @@ jobs:
done
echo Failed waiting for RabbitMQ && exit 1
- run: npm install
- run: npm ci
- run: npm run test

# Invoke jobs via workflows
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
workflows:
sample: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
build-and-deploy:
jobs:
- node-test:
context:
- playground
- aws-ecr/build-and-push-image:
requires:
- node-test # Only run deploy job once tests passed
repo: << pipeline.parameters.repo >>
filters:
branches:
only:
- master
name: Upgrade & Publish into ECR
context: playground-aws
#Job params
tag: "${CIRCLE_SHA1}"

0 comments on commit ba325e1

Please sign in to comment.