-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
39 lines (32 loc) · 1.23 KB
/
.travis.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
language: haskell
cache:
directories:
- $HOME/.stack/
# Download and install Stack executable
before_install:
- mkdir -p ~/.local/bin
- export PATH=~/.local/bin:$PATH
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar -xzO --wildcards '*/stack' > ~/.local/bin/stack
- chmod a+x ~/.local/bin/stack
install:
- stack setup
script:
- stack build --fast
- stack exec site build
deploy:
skip_cleanup: true
provider: script
script: scripts/deploy.sh
on:
branch: master
after_deploy:
- |
# Make POST request URL
DEPLOY_URL="https://$GH_TOKEN@api.github.com/repos/$TRAVIS_REPO_SLUG/deployments"
echo $DEPLOY_URL
# POST a deployment and store the id
DEPLOY_ID=$(curl -XPOST --verbose $DEPLOY_URL -H "Content-Type:application/json" --data '{"ref":"master", "auto_merge":false, "required_contexts": []}' | python -c "import json,sys;obj=json.load(sys.stdin);print obj['id'];")
# Update the deployment with a success status
echo $DEPLOY_ID
DEPLOYED=$(curl -XPOST "https://$GH_TOKEN@api.github.com/repos/$TRAVIS_REPO_SLUG/deployments/$DEPLOY_ID/statuses" --data '{"state":"success"}' | python -c "import json,sys;obj=json.load(sys.stdin);print obj['state'];")
echo $DEPLOYED