Add Travis CI deploy step for release tags (#1558)

* Add sample Travis CI deploy step to tag commits on master and push that

TODO: should find the version number from ./package.json

* Get git name and email for tagging from env

* Extract current version number from manifest

Attempt...

* Update .travis.yml

Fix whitespace issue and command error

* Switch sed order and escape double qoutes

* Replace curly braces by parentheses

* Test deploy of release tag to GitHub

* Convert deploy back to script

And update actual deploy step commands

* Remove test deploy stage

* Fix api_key value and remove leftover configuration
This commit is contained in:
Eric Cornelissen 2019-08-15 13:16:28 +02:00 committed by Johan Fagerberg
parent 55bbd58701
commit 96a8ab301b

View File

@ -22,7 +22,19 @@ jobs:
- npm run test - npm run test
- stage: deploy - stage: deploy
name: "NPM Package" name: "Git tag"
if: branch = master
before_deploy:
- git config --local user.name "$GITHUB_USERNAME"
- git config --local user.email "$GITHUB_EMAIL"
- export PACKAGE_VERSION=$(cat package.json | grep 'version' | sed 's/[ \",:]//g' | sed 's/version//')
- git tag $PACKAGE_VERSION
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
skip_cleanup: true
- name: "NPM Package"
language: node_js language: node_js
node_js: 8 node_js: 8
if: branch = master if: branch = master