Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #184 from thibault-deriv/clean_ci
Browse files Browse the repository at this point in the history
Fix deployment and clean CircleCI config
  • Loading branch information
thibault-deriv authored Apr 28, 2023
2 parents ee35484 + 39bf6ed commit 70b1f0b
Showing 1 changed file with 20 additions and 62 deletions.
82 changes: 20 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,6 @@ orbs:
k8s: circleci/[email protected]
slack: circleci/[email protected]
commands:
git_checkout_from_cache:
description: "Git checkout and save cache"
steps:
- restore_cache:
name: Git restore cache
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
- checkout
- run:
name: Compress git objects
command: git gc
- save_cache:
name: Git save cache
key: source-v1-{{ .Branch }}-{{ .Revision }}
paths:
- ".git"
npm_install:
description: "Install npm modules"
steps:
Expand All @@ -43,30 +25,15 @@ commands:
- run:
name: "yarn build"
command: yarn build
deploy:
description: "Deploy to static branches"
versioning:
description: "Add version to build"
parameters:
target_branch:
type: string
steps:
- checkout
- attach_workspace:
at: lib
- run:
name: Tag build
command: echo "<< parameters.target_branch >> $(date -u +'%Y-%m-%dT%H:%M:%SZ')" > lib/version
- run:
name: Install and configure dependencies
command: |
sudo npm install -g [email protected]
git config user.email "[email protected]"
git config user.name "ci-build"
- add_ssh_keys:
fingerprints:
- "01:67:4a:6d:26:9c:70:c4:1a:60:91:88:d9:dd:f0:83"
- run:
name: Deploy docs to gh-pages branch
command: gh-pages -d lib --branch << parameters.target_branch >> --message '[skip ci]'
docker_build_push:
description: "Build and Push image to docker hub"
steps:
Expand Down Expand Up @@ -125,23 +92,25 @@ commands:
name: "Publish to cloudflare pages (production)"
command: |
cd lib
npx wrangler pages publish . --project-name=binary-live-api-pages --branch=main
npx wrangler pages publish . --project-name=binary-live-api-pages --branch=maintest
echo "New website - http://cf-pages-binary-live-api.binary.com"
jobs:
build:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- checkout
- npm_install
- build
release_staging:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- checkout
- npm_install
- build
- versioning:
target_branch: "staging"
- persist_to_workspace:
root: lib
paths:
Expand All @@ -150,23 +119,15 @@ jobs:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- checkout
- npm_install
- build
- versioning:
target_branch: "production"
- persist_to_workspace:
root: lib
paths:
- .
- deploy:
target_branch: "production"
- notify_slack
release_aws_production:
docker:
- image: circleci/node:9.9.0-stretch
steps:
- git_checkout_from_cache
- npm_install
- build
- docker_build_push
- k8s_deploy
- notify_slack
Expand All @@ -192,24 +153,12 @@ workflows:
filters:
branches:
ignore: /^master$/
release:
release_staging:
jobs:
- release_staging:
filters:
branches:
only: /^master$/
- release_production:
filters:
branches:
ignore: /.*/
tags:
only: /^production.*/
- release_aws_production:
filters:
branches:
ignore: /.*/
tags:
only: /^production.*/
context: binary-frontend-artifact-upload
- publish_cloudflare_staging:
requires:
Expand All @@ -218,6 +167,15 @@ workflows:
branches:
only: /^master$/
context: binary-frontend-artifact-upload
release_production:
jobs:
- release_production:
filters:
branches:
ignore: /.*/
tags:
only: /^production.*/
context: binary-frontend-artifact-upload
- publish_cloudflare_production:
requires:
- release_production
Expand Down

0 comments on commit 70b1f0b

Please sign in to comment.