Skip to content

Commit 96f95e0

Browse files
Merge pull request #23 from artem-forks/travis
Deployment to GH pages via Travis
2 parents 88e3bf4 + fe11aa6 commit 96f95e0

File tree

6 files changed

+32
-25
lines changed

6 files changed

+32
-25
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
tools/contributors/node_modules
22
tools/contributors/contributors.json
3+
/public
4+
/deployment

.gitmodules

Lines changed: 0 additions & 4 deletions
This file was deleted.

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
install:
3+
- wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.52/hugo_0.52_Linux-64bit.deb
4+
- sudo dpkg -i /tmp/hugo.deb
5+
6+
script:
7+
- hugo -t devsec
8+
9+
deploy:
10+
- provider: script
11+
script: ./deploy.sh
12+
skip_cleanup: true
13+
on:
14+
branch: src

deploy.sh

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
#!/bin/bash
22

3-
# This deploy script is from
4-
# https://gohugo.io/hosting-and-deployment/hosting-on-github/#deployment-via-docs-folder-on-master-branch
3+
set -e
54

65
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
76

8-
# Build the project.
9-
hugo -t devsec
7+
echo $GITHUB_AUTH_SECRET > ~/.git-credentials && chmod 0600 ~/.git-credentials
8+
git config --global credential.helper store
9+
git config --global user.email "[email protected]"
10+
git config --global user.name "Artems Bot"
11+
git config --global push.default simple
1012

11-
# Go To Public folder
12-
cd public
13-
# Add changes to git.
14-
git add .
13+
rm -rf deployment
14+
git clone -b master https://github.com/dev-sec/dev-sec.github.io.git deployment
15+
rsync -av --delete --exclude ".git" public/ deployment
16+
cd deployment
17+
git add -A
18+
git commit -m "rebuilding site on `date`, commit ${TRAVIS_COMMIT} and job ${TRAVIS_JOB_NUMBER}" || true
19+
git push
1520

16-
# Commit changes.
17-
msg="rebuilding site `date`"
18-
if [ $# -eq 1 ]
19-
then msg="$1"
20-
fi
21-
git commit -m "$msg"
22-
23-
# Push source and build repos.
24-
git push origin master
25-
26-
# Come Back up to the Project Root
27-
cd ..
21+
cd ..
22+
rm -rf deployment

public

Lines changed: 0 additions & 1 deletion
This file was deleted.

static/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dev-sec.io

0 commit comments

Comments
 (0)