Lanyon deploys

This commit is contained in:
Kevin van Zonneveld 2016-11-30 19:35:44 +01:00
parent a7665cbf4f
commit 049002a1cc
3 changed files with 15 additions and 64 deletions

View File

@ -1,27 +1,26 @@
language: generic
matrix:
include:
- os: linux
sudo: false
- os: osx
- os: linux
sudo: false
- os: osx
env:
global:
- secure: "LBDI3qOC+d2kmPSS8W6L9UF7HFiu1JC4HwK4j0sjGBh+gjRMpCRxFX7p51pbHd480ItDucN/0CMKy+e0umIRR/xrZSbuQqxby68eoT1tQ5nG9gpDTTEgu1n7Z3vPl9aEitMPlP1ovqRRSViBsYU3E5DRb7Vw2lDpCOj/lqAZT0Y="
- secure: HlbJvT0tBn/SM4uWh05ZNaajN6WBeBwmoe97O3lGeIPrZYYqzjD2OqyIZiH/Qxvj/GvqbT8mxeVPW+8kOWeCA/Mud944v5N3IwMS0tl7J0Xs0X68jveDi2D5062n47b3j2zPCgY0bmsGTaEwelQ4ZHaR4xc2OCTkIpkcOStUAYs=
- secure: Z+i9DAetBkHpus+NnQllDpZ3Za7V4wpM2KKmnXy8n/1Ghcm6DdwgKqMQQdOiOaCtlEpZ28HcjVE9zariEbwzQ1kaI2vUVzNqCuFxczK87e0Zc9hs8KDRzrbsCkkXUj6G3YJBVhIsh8u1YOXLE5Yhr/ov2XlnfPMcXOfaugpAyAw=
- secure: CN9Lsqo2UHxvqr883F0yVuFsn99COawF3+5me9cFBxrKmE2fm933NucRh7jnVDI98xa4SEcw4126S0lvmxB4O33JDXsZ5wYpeLgTqkaytS/R5mPKXkuwHDnqjuqtqAn+bIZmBmlkcW6zhuGG2yN/VecVBG8t++seQg6iN8sUrYI=
install:
# Install acceptance test dependencies for OSX
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then which gsed || brew install gnu-sed; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then which gtimeout || brew install coreutils; fi
# Show versions used
- bash --version
- awk --version
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then which gsed || brew install gnu-sed; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then which gtimeout || brew install coreutils;
fi
- bash --version
- awk --version
script: test/acceptance.sh
# Travis docs: Note that pull request builds skip deployment step altogether.
# https://docs.travis-ci.com/user/deployment/#Conditional-Releases-with-on
deploy:
skip_cleanup: true
provider: script
script: website/_scripts/deploy.sh
script: website/.lanyon/vendor/bin/deploy
on:
branch: master
condition: $TRAVIS_OS_NAME = linux

View File

@ -3,7 +3,6 @@
"description": "Copypastable templates to write better bash scripts",
"version": "2.1.0",
"scripts": {
"deploy": "website/_scripts/deploy.sh",
"lint": "shellcheck --shell=bash $(find . -name '*.sh' -maxdepth 2)",
"release:major": "env SEMANTIC=major npm run release",
"release:minor": "env SEMANTIC=minor npm run release",
@ -16,6 +15,8 @@
"web:build:production": "LANYON_ENV=production lanyon build",
"web:serve:production": "LANYON_ENV=production lanyon serve",
"web:build": "lanyon build",
"web:encrypt": "lanyon encrypt",
"web:deploy": "lanyon deploy",
"web:inject": "./website/_scripts/inject.sh",
"web:injecter": "nodemon --verbose --watch ./ --ignore 'website/*.md' --ignore website/_site --ignore website/.lanyon --ext html,json,md,js,css,png,jpg --exec 'npm run web:inject'",
"web:start:production": "npm-run-all web:inject web:build:production web:serve:production",

View File

@ -1,49 +0,0 @@
#!/usr/bin/env bash
# This file:
#
# - Builds website for production
# - Force pushes that to the gh-pages branch
# - On travis, make sure you have encrypted the GHPAGES_URL var
#
# Usage:
#
# ./deploy.sh
#
# Based on a template by BASH3 Boilerplate v2.0.0
# http://bash3boilerplate.sh/#authors
#
# The MIT License (MIT)
# Copyright (c) 2013 Kevin van Zonneveld and contributors
# You are not obligated to bundle the LICENSE file with your b3bp projects as long
# as you leave these references intact in the header comments of your source files.
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
set -o xtrace
echo "--> Deploying to GitHub pages.."
if [ "${TRAVIS:-}" = "true" ]; then
git config --global user.name 'lekevbot'
git config --global user.email 'bot@kvz.io'
fi
if type yarn; then
yarn
else
npm install
fi
npm run web:build:production
pushd website/_site
[ -d .git ] || git init
echo 'This branch is just a deploy target. Do not edit. You changes will be lost.' |tee README.md
git checkout -B gh-pages
git add --all .
git commit -nm "Update website by ${USER}" || true
git remote add origin ${GHPAGES_URL} || true
git push origin gh-pages:refs/heads/gh-pages || git push origin gh-pages:refs/heads/gh-pages --force > /dev/null
popd