This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Clean CI * New command name is versioning
- Loading branch information
1 parent
d343af0
commit a00cb9f
Showing
1 changed file
with
12 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,33 +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: | ||
keys: | ||
- source-v1-{{ .Branch }}-{{ .Revision }} | ||
- source-v1-{{ .Branch }}- | ||
- source-v1- | ||
- run: | ||
name: Fetch git tags | ||
command: | | ||
mkdir -p ~/.ssh | ||
ssh-keyscan github.com >> ~/.ssh/known_hosts | ||
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ' >> ~/.ssh/known_hosts | ||
# Fetch tags if git cache is present | ||
if [ -e /home/circleci/project/.git ] | ||
then | ||
git fetch origin --tags | ||
fi | ||
- checkout | ||
- run: | ||
name: Compress git objects | ||
command: git gc | ||
- save_cache: | ||
key: source-v1-{{ .Branch }}-{{ .Revision }} | ||
paths: | ||
- ".git" | ||
npm_install: | ||
description: "npm install and save cache" | ||
steps: | ||
|
@@ -60,15 +33,12 @@ commands: | |
- run: | ||
name: Building dist for << parameters.target >> | ||
command: node_modules/grunt/bin/grunt releaseci --<< parameters.target >> | ||
deploy: | ||
description: "Deploy to static branches" | ||
versioning: | ||
description: "Add version to build" | ||
parameters: | ||
target_branch: | ||
type: string | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: dist | ||
- run: | ||
name: Tag build | ||
command: echo "<< parameters.target_branch >> $(date -u +'%Y-%m-%dT%H:%M:%SZ')" > dist/version | ||
|
@@ -141,32 +111,34 @@ commands: | |
name: "Publish to cloudflare pages (production)" | ||
command: | | ||
cd dist | ||
npx wrangler pages publish . --project-name=binary-static-pages --branch=main | ||
npx wrangler pages publish . --project-name=binary-static-pages --branch=main-test | ||
echo "New website - http://cf-pages-binary-static.binary.com" | ||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/node:14-stretch | ||
steps: | ||
- git_checkout_from_cache | ||
- checkout | ||
- npm_install | ||
- test | ||
release_staging: | ||
docker: | ||
- image: circleci/node:14-stretch | ||
steps: | ||
- git_checkout_from_cache | ||
- checkout | ||
- npm_install | ||
- test | ||
- build: | ||
target: 'staging' | ||
- build: | ||
target: 'translations' | ||
- versioning: | ||
target_branch: "staging" | ||
- persist_to_workspace: | ||
root: dist | ||
paths: | ||
- . | ||
- deploy: | ||
- versioning: | ||
target_branch: "staging" | ||
- docker_build_push | ||
- k8s_deploy | ||
|
@@ -175,42 +147,32 @@ jobs: | |
docker: | ||
- image: circleci/node:14-stretch | ||
steps: | ||
- git_checkout_from_cache | ||
- checkout | ||
- npm_install | ||
- test | ||
- build: | ||
target: 'production' | ||
- versioning: | ||
target_branch: "production" | ||
- persist_to_workspace: | ||
root: dist | ||
paths: | ||
- . | ||
- deploy: | ||
target_branch: "production" | ||
- notify_slack | ||
release_aws_production: | ||
docker: | ||
- image: circleci/node:14-stretch | ||
steps: | ||
- git_checkout_from_cache | ||
- npm_install | ||
- test | ||
- build: | ||
target: 'production' | ||
- docker_build_push: | ||
docker_latest_image_tag: latest | ||
docker_image_tag: ${CIRCLE_TAG} | ||
- k8s_deploy: | ||
k8s_svc_name: "production-binary-com" | ||
k8s_namespace: "www-binary-com-production" | ||
k8s_version: ${CIRCLE_TAG} | ||
- notify_slack | ||
publish_cloudflare_staging: | ||
docker: | ||
- image: circleci/node:16.13.1-stretch | ||
steps: | ||
- attach_workspace: | ||
at: dist | ||
- publish_to_pages_staging | ||
|
||
publish_cloudflare_production: | ||
docker: | ||
- image: circleci/node:16.13.1-stretch | ||
|
@@ -247,13 +209,6 @@ workflows: | |
tags: | ||
only: /^production.*/ | ||
context: binary-frontend-artifact-upload | ||
- release_aws_production: | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^production.*/ | ||
context: binary-frontend-artifact-upload | ||
- publish_cloudflare_production: | ||
requires: | ||
- release_production | ||
|
a00cb9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
binary-static – ./
binary-static-git-master.binary.sx
binary-static.binary.sx