Browse Source

🔧 add deploy command and script 🔨

pull/1/head
abouhanifa 5 years ago
parent
commit
31f1dce033
  1. 24
      .circleci/config.yml
  2. 3
      package.json

24
.circleci/config.yml

@ -61,7 +61,23 @@ jobs:
- node_modules - node_modules
key: v1-dependencies-{{ checksum "package.json" }} key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn run build - run: yarn run build
deploy_to_netlify:
docker:
- image: node:10.18.0
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn global add netlify-cli
- run: yarn run build && yarn run netlify:deploy
workflows: workflows:
project_workflows: project_workflows:
jobs: jobs:
@ -70,3 +86,9 @@ workflows:
- build: - build:
requires: requires:
- test - test
- deploy_to_netlify:
requires:
- build
filters:
branches:
only: main

3
package.json

@ -16,7 +16,8 @@
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "test": "react-scripts test",
"format:write": "prettier --write \"**/*.{js,vue,json,ts,tsx,md,yml,html}\"", "format:write": "prettier --write \"**/*.{js,vue,json,ts,tsx,md,yml,html}\"",
"format:check": "prettier --list-different \"**/*.{js,vue,json,ts,tsx,md,yml,html}\""
"format:check": "prettier --list-different \"**/*.{js,vue,json,ts,tsx,md,yml,html}\"",
"netlify:deploy": "netlify deploy --dir=./build -p -m \"$(git log -1 --pretty=%B)\""
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [

Loading…
Cancel
Save