Skip to content

Commit 97d9e10

Browse files
committed
Build script for deploying to github pages
1 parent 79f56b7 commit 97d9e10

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*.iml
22
.idea
33
build
4-
public

.travis.yml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,23 @@ python:
55

66
install:
77
# install latest release version
8-
# - wget $(wget -qO- https://api.github.com/repos/gohugoio/hugo/releases/latest | sed -r -n '/browser_download_url/{/Linux-64bit.deb/{s@[^:]*:[[:space:]]*"([^"]*)".*@\1@g;p}}')
98
- wget -qO- https://api.github.com/repos/gohugoio/hugo/releases/latest | sed -r -n '/browser_download_url/{/Linux-64bit.deb/{s@[^:]*:[[:space:]]*"([^"]*)".*@\1@g;p}}' | xargs wget
109
- sudo dpkg -i hugo*.deb
1110
- pip install Pygments
1211
- rm -rf public 2> /dev/null
13-
# - sudo apt-get install -y expect
14-
- sudo apt-get install build-essential debhelper libssh-dev
15-
- sudo apt-get source curl
16-
- sudo apt-get build-dep curl
17-
- cd curl-*
18-
- sudo sed -i 's/CONFIGURE_ARGS += --without-libssh2/CONFIGURE_ARGS += --with-libssh2/g' debian/rules
19-
# - wget https://bugs.launchpad.net/ubuntu/+source/curl/+bug/311029/+attachment/5234644/+files/ubuntu_libssl.patch
20-
# - sudo patch debian/rules < /ubuntu_libssl.patch
21-
- sudo dpkg-buildpackage -uc -us -b
22-
- cd ..
23-
- sudo dpkg -i curl_*.deb
24-
- sudo dpkg -i libcurl3-*.deb
25-
- sudo dpkg -i libcurl3-gnutls_*.deb
26-
- sudo apt-mark hold curl
27-
- sudo apt-mark hold libcurl3
28-
- sudo apt-mark hold libcurl3-gnutls
2912

3013
script:
31-
# - cd graphql-java-servlet
3214
- hugo
3315

34-
after_success:
16+
deploy:
17+
- provider: script
18+
script: ./deploy.sh
19+
skip_cleanup: true
20+
on:
21+
branch: master
22+
23+
#after_success:
3524
# - ssh-keyscan -H graphql-java-kickstart.com.transurl.nl >> ~/.ssh/known_hosts
3625
# - expect upload.exp
3726
# - sshpass -p "${SFTP_PASSWORD}" scp -v -r public ${SFTP_USER}@graphql-java-kickstart.com.transurl.nl:/www
38-
- find public -type f -exec curl --ftp-create-dirs -T {} sftp://${SFTP_USER}:${SFTP_PASSWORD}@graphql-java-kickstart.com.transurl.nl/www/{} \;
27+
# - find public -type f -exec curl --ftp-create-dirs -T {} sftp://${SFTP_USER}:${SFTP_PASSWORD}@graphql-java-kickstart.com.transurl.nl/www/{} \;

deploy.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
3+
cd public
4+
if [ -n "$GITHUB_AUTH_SECRET" ]
5+
then
6+
touch ~/.git-credentials
7+
chmod 0600 ~/.git-credentials
8+
echo "${GITHUB_AUTH_SECRET}" > ~/.git-credentials
9+
git config credential.helper store
10+
git config user.email "graphql-java-kickstart-bot@users.noreply.github.com"
11+
git config user.name "graphql-java-kickstart-bot"
12+
fi
13+
git add .
14+
git commit -m "Rebuild site"
15+
git push --force origin HEAD:master

0 commit comments

Comments
 (0)