Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostza1209 authored Feb 17, 2020
2 parents fcb370f + 77a2f3d commit 756a531
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
36 changes: 17 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ jobs:
build:
docker:
- image: circleci/node:12.14.0

working_directory: ~/repo

steps:
- checkout

Expand All @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ sketch
#env
.env

# End of https://www.gitignore.io/api/react
# End of https://www.gitignore.io/api/react
# Local Netlify folder
.netlify
15 changes: 8 additions & 7 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ const Index: FunctionComponent = () => {
}
`;

// the hook that calls the query.
const { data, loading, error } = useQuery(USERS);
return (
<Layouts>
<LandingPage />
</Layouts>
);
// the hook that calls the query.
const { data, loading, error } = useQuery(USERS);
return (
<Layouts>
<p>Landing page</p>
<LandingPage />
</Layouts>
);
};
export default withApollo(Index, { ssr: true });

0 comments on commit 756a531

Please sign in to comment.