Skip to content

Commit 41ed3ce

Browse files
committed
ci: only run deploy when pushing to master
1 parent 6d054b5 commit 41ed3ce

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.circleci/config.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2
1+
version: 2.1
22

33
jobs:
44

@@ -23,25 +23,31 @@ jobs:
2323
- run:
2424
name: Build Website
2525
command: yarn build
26-
- persist_to_workspace:
27-
root: .
28-
paths:
29-
- build
30-
- node_modules
3126

3227
deploy-gh-pages:
3328
docker:
3429
- image: circleci/node:16.8.0
3530
steps:
3631
- checkout
32+
- restore_cache:
33+
keys:
34+
# when lock file changes, use increasingly general patterns to restore cache
35+
- yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
36+
- yarn-packages-v1-{{ .Branch }}-
37+
- yarn-packages-v1-
38+
- run:
39+
name: Install dependencies
40+
command: yarn install || true # Temporary until TS errors are fixed in docusaurus
41+
- save_cache:
42+
paths:
43+
- ~/.cache/yarn
44+
key: yarn-packages-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
3745
- run:
3846
name: Configure Git Credentials
3947
command: |
4048
git config --global user.email "computerizationbot@gmail.com"
4149
git config --global user.name "computerization-bot"
4250
echo "machine github.com login computerization-bot password $GITHUB_DOCUSAURUS_BOT" > ~/.netrc
43-
- attach_workspace:
44-
at: .
4551
- run:
4652
name: Deploy to GitHub Pages
4753
command: yarn deploy
@@ -52,18 +58,15 @@ jobs:
5258
DEPLOYMENT_BRANCH: master
5359
CURRENT_BRANCH: master
5460

55-
5661
workflows:
57-
version: 2
62+
version: 2.1
5863
build-deploy:
5964
jobs:
6065
- build:
6166
filters:
6267
branches:
63-
ignore: gh-pages
68+
ignore: master
6469
- deploy-gh-pages:
65-
requires:
66-
- build
6770
filters:
6871
branches:
6972
only: master

0 commit comments

Comments
 (0)