diff --git a/.gitignore b/.gitignore index 18f2c0c..fc587c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ tools/contributors/node_modules tools/contributors/contributors.json +/public +/deployment diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a152e9c..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "public"] - path = public - url = git@github.com:dev-sec/dev-sec.github.io.git - branch = master diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8a4e2ae --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +--- +install: + - wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.52/hugo_0.52_Linux-64bit.deb + - sudo dpkg -i /tmp/hugo.deb + +script: + - hugo -t devsec + +deploy: + - provider: script + script: ./deploy.sh + skip_cleanup: true + on: + branch: src diff --git a/deploy.sh b/deploy.sh index b90cfeb..fa39b25 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,27 +1,22 @@ #!/bin/bash -# This deploy script is from -# https://gohugo.io/hosting-and-deployment/hosting-on-github/#deployment-via-docs-folder-on-master-branch +set -e echo -e "\033[0;32mDeploying updates to GitHub...\033[0m" -# Build the project. -hugo -t devsec +echo $GITHUB_AUTH_SECRET > ~/.git-credentials && chmod 0600 ~/.git-credentials +git config --global credential.helper store +git config --global user.email "artem-bot@users.noreply.github.com" +git config --global user.name "Artems Bot" +git config --global push.default simple -# Go To Public folder -cd public -# Add changes to git. -git add . +rm -rf deployment +git clone -b master https://github.com/dev-sec/dev-sec.github.io.git deployment +rsync -av --delete --exclude ".git" public/ deployment +cd deployment +git add -A +git commit -m "rebuilding site on `date`, commit ${TRAVIS_COMMIT} and job ${TRAVIS_JOB_NUMBER}" || true +git push -# Commit changes. -msg="rebuilding site `date`" -if [ $# -eq 1 ] - then msg="$1" -fi -git commit -m "$msg" - -# Push source and build repos. -git push origin master - -# Come Back up to the Project Root -cd .. \ No newline at end of file +cd .. +rm -rf deployment diff --git a/public b/public deleted file mode 160000 index ee9a7c4..0000000 --- a/public +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ee9a7c4371b3ca13d59927cd5229b6d4733ce1b2 diff --git a/static/CNAME b/static/CNAME new file mode 100644 index 0000000..fd68c22 --- /dev/null +++ b/static/CNAME @@ -0,0 +1 @@ +dev-sec.io