Hello, I try to setup custom tag for specific branch/tag. I want to push to ECR only when branch is staging or tag.
In general it should works like this one
workflows:
version: 2
backend:
jobs:
- aws-ecr/build-and-push-image:
pre-steps:
- run:
name: Setup Docker Image Tag
command: |
if [ $CIRCLE_TAG ]; then
ENV=production
elif [ "$CIRCLE_BRANCH" = "staging" ]; then
ENV=staging
fi
repo: "${AWS_RESOURCE_NAME_PREFIX}"
tag: "$ENV"
filters:
branches:
only: staging
tags:
only:
- /^v\d+\.\d+\.\d+$/
But it doesn’t work for me. Where I’m wrong?