version: 2 jobs: build_latest: docker: - image: circleci/node:14.18.0 working_directory: ~/zdamegzaminzawodowy steps: - checkout - setup_remote_docker: version: 20.10.2 - run: | docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD # build the application image - run: docker build -t $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:latest . # deploy the image - run: docker push $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:latest build_version: docker: - image: circleci/node:14.18.0 working_directory: ~/zdamegzaminzawodowy steps: - checkout - setup_remote_docker: version: 20.10.2 - run: | docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD # build the application image - run: docker build -t $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:$(echo $CIRCLE_TAG | sed -r 's/^.{1}//') . # deploy the image - run: docker push $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:$(echo $CIRCLE_TAG | sed -r 's/^.{1}//') workflows: version: 2 deploy_latest: jobs: - build_latest: context: Zdam-Egzamin-Zawodowy filters: branches: only: - master deploy_version: jobs: - build_version: context: Zdam-Egzamin-Zawodowy filters: tags: only: /^v.*/ branches: ignore: /.*/