From 0c931824364bdb5db5a7fd867ddf9a125034f81b Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Wed, 1 Feb 2023 09:25:43 +0100 Subject: [PATCH] Add CircleCI workflow to deploy CI to canary and production --- .circleci/config.yml | 29 ++++++++++++++++++- api/seeds/twenty/1675183813451_seed.sql | 0 ...944004_seed.sql => 1675183844004_seed.sql} | 0 3 files changed, 28 insertions(+), 1 deletion(-) delete mode 100644 api/seeds/twenty/1675183813451_seed.sql rename api/seeds/twenty/{1675183944004_seed.sql => 1675183844004_seed.sql} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed35e05b5..31a25f1f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,6 +22,18 @@ jobs: - run: command: cd front && npm run test name: tests + deploy-api-canary: + docker: + - image: hasura/graphql-engine:latest.cli-migrations-v3 + steps: + - checkout + - run: cd api && /bin/hasura-cli deploy --admin-secret $HASURA_ADMIN_SECRET --endpoint $HASURA_CANARY_ENDPOINT + deploy-api: + docker: + - image: hasura/graphql-engine:latest.cli-migrations-v3 + steps: + - checkout + - run: cd api && /bin/hasura-cli deploy --admin-secret $HASURA_ADMIN_SECRET --endpoint $HASURA_ENDPOINT workflows: build-and-deploy-server: @@ -96,7 +108,22 @@ workflows: --build-arg REACT_APP_AUTH0_AUDIENCE=$REACT_APP_AUTH0_AUDIENCE --build-arg REACT_APP_API_URL=$REACT_APP_API_URL - build-and-deploy-api: + deploy-api: + jobs: + - deploy-api-canary + - slack/on-hold: + name: slack-notification + context: slack-secrets + requires: + - deploy-api-canary + - hold: + type: approval + requires: + - slack-notification + - deploy-api: + requires: + - hold + build-api: when: << pipeline.parameters.build-api >> jobs: - aws-ecr/build-and-push-image: diff --git a/api/seeds/twenty/1675183813451_seed.sql b/api/seeds/twenty/1675183813451_seed.sql deleted file mode 100644 index e69de29bb..000000000 diff --git a/api/seeds/twenty/1675183944004_seed.sql b/api/seeds/twenty/1675183844004_seed.sql similarity index 100% rename from api/seeds/twenty/1675183944004_seed.sql rename to api/seeds/twenty/1675183844004_seed.sql