diff --git a/.travis.yml b/.travis.yml index 552534b66..5095460ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,18 +15,17 @@ before_deploy: - rm -Rf ./node_modules .docs ./preview ./tests *.log* - rm -Rf ./src/system/icons/_all - rm -Rf ./src/system/tokens/_examples + deploy: - provider: npm skip_cleanup: true email: $NPM_EMAIL api_key: $NPM_TOKEN on: - tags: true - branch: master + condition: ./deployment_condition.sh - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable keep_history: true on: - tags: true - branch: master + condition: ./deployment_condition.sh diff --git a/deployment_condition.sh b/deployment_condition.sh new file mode 100755 index 000000000..ff5658916 --- /dev/null +++ b/deployment_condition.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +BRANCH=$(git rev-parse --abbrev-ref HEAD) + +if [ "$BRANCH" != "master" ]; then + exit 1 +fi + +CURRENT_VERSION=$(cat package.json | jq -r .version) +PUBLISHED_VERSION=$(yarn info @human-connection/styleguide version --silent) + +if [ "$CURRENT_VERSION" == "$PUBLISHED_VERSION" ]; then + exit 1 +fi + + +exit 0 diff --git a/package.json b/package.json index 38daec284..4e7aa2380 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@human-connection/styleguide", - "version": "0.5.20", + "version": "0.5.21", "private": false, "scripts": { "serve": "http-server ./docs -o -s",