-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
46 lines (46 loc) · 1.44 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
version: 2
jobs:
build:
docker:
- image: fpco/stack-build:lts
steps:
- checkout
- restore_cache:
name: Restore Cached Dependencies
keys:
# find a cache for the same stack.yaml
- stack-{{ .Branch }}-{{ checksum "stack.yaml" }}
# when missing reuse from the same branch
- stack-{{ .Branch }}-
# when missing reuse the latest cache
- stack-
- run:
name: Resolve/Update Dependencies
command: stack setup
command: stack build --dependencies-only
- save_cache:
name: Cache Dependencies
key: stack-{{ .Branch }}-{{ checksum "stack.yaml" }}
paths:
- ~/.stack
- ./.stack-work
- run:
name: Build Site App
command: stack build --pedantic
- run:
name: Generate Static Site
command: stack exec site build
- run:
name: Publish GitHub Pages
working_directory: './_site'
command: |
# initalize repo
git init
git config user.name 'CircleCI'
git config user.email 'job@circleci.com'
# add generated files
git add .
git commit -m "publish $CIRCLE_SHA1 [ci skip]"
# push to pages branch
git remote add origin "$CIRCLE_REPOSITORY_URL"
git push --force origin master