-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Styled-components and react are now a reality of project seed.
- Loading branch information
1 parent
93efc88
commit 37c8d20
Showing
25 changed files
with
2,897 additions
and
2,989 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 |
---|---|---|
@@ -1,65 +1,100 @@ | ||
# https://github.com/developmentseed/how/issues/149 | ||
# ssh-keygen -m pem -t rsa -b 4096 -C ORG/REPO -f deploy_key | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: node:8 | ||
# ssh-keygen -m pem -t rsa -b 4096 -C developmentseed/project-seed -f deploy_key | ||
|
||
working_directory: ~/repo | ||
# YAML anchors for base definitions | ||
base_def: &base_def | ||
docker: | ||
- image: node:10 | ||
working_directory: ~/repo | ||
environment: | ||
- DEVELOPMENT_BRANCH: develop | ||
- PRODUCTION_BRANCH: master | ||
|
||
environment: | ||
- STAGING_BRANCH: develop | ||
- PRODUCTION_BRANCH: master | ||
- GH_REF: [email protected]:developmentseed/project-seed.git | ||
- GH_NAME: "Development Seed" | ||
- GH_EMAIL: "[email protected]" | ||
restore_cache_def: &restore_cache_def | ||
# Download and cache dependencies | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- # fallback if checksum fails | ||
|
||
## | ||
## START Circle CI configuration | ||
## | ||
|
||
version: 2.1 | ||
jobs: | ||
prepare: | ||
<<: *base_def | ||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
<<: *restore_cache_def | ||
- run: yarn install | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
|
||
lint: | ||
<<: *base_def | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
<<: *restore_cache_def | ||
- run: yarn lint | ||
- run: yarn lint:css | ||
test: | ||
<<: *base_def | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
<<: *restore_cache_def | ||
- run: yarn test | ||
|
||
- add_ssh_keys: | ||
fingerprints: | ||
- "" | ||
|
||
build: | ||
<<: *base_def | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
<<: *restore_cache_def | ||
- run: yarn build | ||
- persist_to_workspace: | ||
root: ~/repo | ||
paths: | ||
- dist/* | ||
deploy-surge: | ||
<<: *base_def | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
<<: *restore_cache_def | ||
- attach_workspace: | ||
at: /workspace | ||
- run: | ||
name: Building site | ||
name: Deploy to surge | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" == "${PRODUCTION_BRANCH}" ]; then | ||
yarn build | ||
else | ||
echo "Skip building site" | ||
fi | ||
cp /workspace/dist/index.html /workspace/dist/200.html | ||
# Enable to use surge deployment | ||
# CIRCLE will need the surge login variables: | ||
# SURGE_LOGIN & SURGE_TOKEN | ||
#./node_modules/surge/lib/cli.js --project /workspace/dist --domain <the domain>.surge.sh | ||
- run: | ||
name: Deploy to GH Pages | ||
command: | | ||
if [ "${CIRCLE_BRANCH}" == "${PRODUCTION_BRANCH}" ]; then | ||
cd dist | ||
git init | ||
git config user.name "$GH_NAME" | ||
git config user.email "$GH_EMAIL" | ||
git add . | ||
git commit -m "CI deploy [skip ci]" | ||
git remote add origin $GH_REF | ||
git push origin --force --quiet HEAD:gh-pages | ||
rm -rf .git | ||
else | ||
echo "Skip deploying to Github" | ||
fi | ||
workflows: | ||
version: 2 | ||
main: | ||
jobs: | ||
- prepare | ||
- lint: | ||
requires: | ||
- prepare | ||
- test: | ||
requires: | ||
- prepare | ||
- build: | ||
requires: | ||
- prepare | ||
- deploy-surge: | ||
requires: | ||
- lint | ||
- test | ||
- build | ||
filters: | ||
branches: | ||
only: master |
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
12 | ||
14 |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"semi": true, | ||
"trailingComma": "none", | ||
"singleQuote": true, | ||
"jsxSingleQuote": true, | ||
"printWidth": 80 | ||
} |
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"extends": [ | ||
"stylelint-config-recommended" | ||
] | ||
], | ||
"rules": { | ||
"font-family-no-missing-generic-family-keyword": null | ||
} | ||
} |
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.