From c12751c60e18cff9111b835c2be76dfd018f9d49 Mon Sep 17 00:00:00 2001 From: Koki Yoshida Date: Wed, 18 Nov 2020 17:05:53 -0800 Subject: [PATCH] Add CircleCI workflow to push images automatically --- .circleci/config.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69a6a84..0b43df3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,11 +24,27 @@ jobs: name: Run unit tests command: | make test + + publish: + <<: *defaults + steps: + - run: + name: Login to gcr.io + command: | + gcloud auth activate-service-account --key-file <(echo "$PUSH_TO_GCR_STACKROX_HUB") + gcloud auth list + gcloud --quiet auth configure-docker + - checkout + - run: + name: Build and push image + command: make push workflows: build: jobs: - lint: - context: docker-io-pull + context: gcr-io-stackrox-hub-push - test: - context: docker-io-pull + context: gcr-io-stackrox-hub-push + - publish: + context: gcr-io-stackrox-hub-push