Skip to content

Commit b6d4a75

Browse files
author
Purvi Kanal
committed
test github pages deploy script
1 parent 5ff2489 commit b6d4a75

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ executors:
44
node_executor:
55
docker:
66
- image: circleci/node:8
7+
environment:
8+
- SOURCE_BRANCH: master
9+
- TARGET_BRANCH: gh-pages
710
jobs:
811
build:
912
executor: node_executor
@@ -42,10 +45,7 @@ jobs:
4245
command: yarn build
4346
- run:
4447
name: Deploying to GitHub Pages
45-
command: |
46-
git config --global user.email $GH_EMAIL
47-
git config --global user.name $GH_NAME
48-
yarn deploy
48+
command: ./scripts/deploy.sh
4949

5050
workflows:
5151
version: 2

scripts/deploy.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
git config --global user.email $GH_EMAIL
3+
git config --global user.name $GH_NAME
4+
5+
git clone $CIRCLE_REPOSITORY_URL out
6+
7+
cd out
8+
git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH
9+
git rm -rf .
10+
cd ..
11+
12+
yarn build
13+
14+
cp -a build/. out/.
15+
16+
mkdir -p out/.circleci && cp -a .circleci/. out/.circleci/.
17+
cd out
18+
19+
git add -A
20+
git commit -m "Automated deployment to GitHub Pages: ${CIRCLE_SHA1}" --allow-empty
21+
22+
git push origin $TARGET_BRANCH

src/presentation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React from 'react';
33
import { Deck } from 'spectacle';
44
import createTheme from 'spectacle/lib/themes/default';
5-
import { colours, fontFamilies, progress } from './theme';
5+
import { colours, fontFamilies } from './theme';
66
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';
77
import {
88
functionsSlideList,

0 commit comments

Comments
 (0)