diff --git a/.circleci/config.yml b/.circleci/config.yml index ee523fe..e4ba674 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: # https://circleci.com/docs/env-vars/#alpine-linux shell: /bin/sh -leo pipefail docker: - - image: docker:20-git + - image: docker:24-git environment: - IMAGE: taraxa-indexer - GOOGLE_PROJECT_ID: jovial-meridian-249123 @@ -21,23 +21,22 @@ jobs: echo "export VERSION=$(git rev-parse --short HEAD)" >> $BASH_ENV - run: - name: Login into gcr - command: | + name: Login into gcr + command: | echo ${GCLOUD_SERVICE_KEY} | docker login -u _json_key --password-stdin https://gcr.io - setup_remote_docker: - version: 20.10.14 docker_layer_caching: true - run: name: Build docker image - command: | + command: | docker build -t ${IMAGE}:${VERSION} . - run: name: Tag docker image - command: | - + command: | + if [[ ${CIRCLE_BRANCH} == "main" ]]; then docker tag ${IMAGE}:${VERSION} ${GCP_IMAGE}:${CIRCLE_SHA1} docker tag ${IMAGE}:${VERSION} ${GCP_IMAGE}:${VERSION} @@ -57,7 +56,7 @@ jobs: - run: name: Push docker image to registry - command: | + command: | if [[ ${CIRCLE_BRANCH} == "main" ]]; then docker push ${GCP_IMAGE}:${CIRCLE_SHA1} @@ -77,7 +76,6 @@ jobs: fi workflows: - build-and-push-docker-image: jobs: - build_and_push_docker_image: @@ -85,7 +83,7 @@ workflows: - GCR filters: branches: - only: + only: - main - develop tags: