Skip to content

Commit 7dcd1bb

Browse files
committed
Build and upload website (nirum.org)
Close #142
1 parent 07f8450 commit 7dcd1bb

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ script:
126126
- 'TOX="$(python3 -m site --user-base)/bin/tox" stack --no-terminal test -j4 --coverage'
127127
- ./lint.sh
128128

129+
# Build website
130+
- stack runhaskell ./app/nirum-docs.hs /tmp/nirum.org/
131+
129132
after_script:
130133
- |
131134
# Since codecov-haskell doesn't work on Windows,
@@ -142,6 +145,11 @@ after_script:
142145
--token="$(echo $token_encoded | python -m base64 -d)" \
143146
spec
144147
148+
# Used for making a commit into gh-pages (nirum.org website)
149+
- git log -n1 --format="format:%s%n%n$TRAVIS_COMMIT_RANGE" > /tmp/git-commit
150+
- git log -n1 --format="format:%an" > /tmp/git-author
151+
- git log -n1 --format="format:%ae" > /tmp/git-author-email
152+
145153
notifications:
146154
webhooks:
147155
urls:
@@ -235,3 +243,20 @@ after_deploy: |
235243
python -c 'import json, os; print(json.dumps({"username": os.environ["HACKAGE_USERNAME"], "password": os.environ["HACKAGE_PASSWORD"]}))' > ~/.stack/upload/credentials.json
236244
stack --no-terminal upload --ignore-check --no-signature .
237245
fi
246+
247+
# Upload website to nirum.org
248+
echo "$NIRUM_GH_PAGES_KEY" | tr / '\n' > /tmp/nirum_org_ed25519
249+
chmod 600 /tmp/nirum_org_ed25519
250+
eval "$(ssh-agent -s)"
251+
ssh-add /tmp/nirum_org_ed25519
252+
pushd /tmp/nirum.org/
253+
git init
254+
git config user.name "$(cat /tmp/git-author)"
255+
git config user.email "$(cat /tmp/git-author-email)"
256+
echo nirum.org > CNAME
257+
touch .nojekyll
258+
git add .
259+
git commit -a -F /tmp/git-commit
260+
git push -f [email protected]:nirum-lang/nirum-lang.github.io.git master
261+
popd
262+
rm /tmp/nirum_org_ed25519

0 commit comments

Comments
 (0)