diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6021a421..356ba579 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -3,9 +3,6 @@ jobs:
build:
docker:
- image: circleci/node:12.14.0
-
- working_directory: ~/repo
-
steps:
- checkout
@@ -21,29 +18,30 @@ jobs:
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
+ - run:
+ name: Build Public
+ command: npm run build
+ - persist_to_workspace:
+ root: /home/circleci/project
+ paths:
+ - public
deploy-prod:
- machine: true
- # docker:
- # - image: circleci/node:12.14.0
+ docker:
+ - image: circleci/node:12.14.0
+
steps:
- checkout
+ - attach_workspace:
+ at: /home/circleci/project/
+
- run:
- name: Setup VirtualEnv
- command: |
- echo 'export TAG=0.1.${CIRCLE_BUILD_NUM}' >> $BASH_ENV
- echo 'export IMAGE_NAME=${IMAGE_NAME}' >> $BASH_ENV
+ name: install netlify cli
+ command: sudo npm install netlify-cli -g
- run:
- name: 'Build and push Docker image'
- command: |
- docker build -t $IMAGE_NAME:$TAG .
- echo $HUB_PASSWORD | docker login $HOST_REGISTRY -u $HUB_USERNAME -p $HUB_PASSWORD
- docker push $IMAGE_NAME:$TAG
+ name: Netlify Deploy
+ command: netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --dir=public
- - run:
- name: 'Deploy app to Digital Ocean Server via Docker'
- command: |
- ssh -i ~/.ssh/id_rsa_circleci $DROPLET_USER@$DROPLET_IP "/bin/bash ./deploy_project.sh $IMAGE_NAME:$TAG"
workflows:
version: 2
build-and-deploy:
diff --git a/.gitignore b/.gitignore
index 42efce6e..2fef2059 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,4 +23,6 @@ sketch
#env
.env
-# End of https://www.gitignore.io/api/react
\ No newline at end of file
+# End of https://www.gitignore.io/api/react
+# Local Netlify folder
+.netlify
\ No newline at end of file
diff --git a/pages/index.tsx b/pages/index.tsx
index 7a292703..8c20ace2 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -15,12 +15,13 @@ const Index: FunctionComponent = () => {
}
`;
- // the hook that calls the query.
- const { data, loading, error } = useQuery(USERS);
- return (
-
-
-
- );
+ // the hook that calls the query.
+ const { data, loading, error } = useQuery(USERS);
+ return (
+
+ Landing page
+
+
+ );
};
export default withApollo(Index, { ssr: true });