Created scripts for automatic deployment

This commit is contained in:
2019-07-10 17:43:53 +00:00
parent 4ee876e192
commit feecf49bf4
3 changed files with 34 additions and 0 deletions

27
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,27 @@
// FTP auto-deploy
// instructions here: https://is.gd/D84vXz
image: ruby:2.4.1
stages:
- deploy
before_script:
- apt-get update -qq && apt-get install -y -qq libcurl4-openssl-dev lftp
- bundle install
- gem install jekyll
- gem install jekyll-theme-minima
deploy_script:
stage: deploy
only:
- master
environment:
name: website
url: https://cmci.colorado.edu/cmci
script:
- echo "Building.."
- chmod +x ./_scripts/build.sh
- ./_scripts/build.sh
- echo "Deploying.."
- chmod +x ./_scripts/deploy_website.sh
- ./_scripts/deploy_website.sh

3
_scripts/build.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
bundle exec jekyll build --config _config.yml

View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Uploading"
cd _site || exit
lftp -p 21 -u $CU_USR,$CU_PASSWORD $CU_HOSTNAME -e "set ftp:ssl-allow no; mirror -R . $CU_DIR; bye"