2019-01-17 17:07:37 +00:00
|
|
|
language: node_js
|
|
|
|
node_js:
|
2019-03-07 10:37:00 +00:00
|
|
|
- '8'
|
2019-01-17 17:07:37 +00:00
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
2019-03-07 10:37:00 +00:00
|
|
|
- node_modules
|
|
|
|
|
|
|
|
install:
|
|
|
|
- npm install
|
2019-01-17 17:07:37 +00:00
|
|
|
|
2019-03-15 09:45:15 +00:00
|
|
|
stages:
|
|
|
|
- test
|
|
|
|
- name: deploy
|
|
|
|
if: type != pull_request AND branch = master
|
2019-03-23 23:36:11 +00:00
|
|
|
- release
|
2019-03-06 23:45:23 +00:00
|
|
|
|
2019-02-22 09:18:14 +00:00
|
|
|
jobs:
|
|
|
|
include:
|
2019-03-15 09:45:15 +00:00
|
|
|
- stage: test
|
|
|
|
script:
|
|
|
|
- npm run lint:nofix
|
|
|
|
- npm run test:unit
|
2019-03-07 10:37:00 +00:00
|
|
|
- stage: deploy
|
2019-04-11 08:20:18 +00:00
|
|
|
before_script:
|
2019-05-03 07:53:29 +00:00
|
|
|
- echo BASE_URL=./ > .env
|
|
|
|
- echo VUE_APP_ALERTA_ENDPOINT=https://alerta-api.herokuapp.com >> .env
|
2019-04-11 08:20:18 +00:00
|
|
|
- echo VUE_APP_TRACKING_ID=UA-44644195-7 >> .env
|
2019-03-07 10:37:00 +00:00
|
|
|
script: npm run build
|
|
|
|
deploy:
|
|
|
|
- provider: pages
|
|
|
|
skip-cleanup: true
|
|
|
|
github-token: "$GITHUB_TOKEN"
|
|
|
|
target-branch: gh-pages
|
|
|
|
local-dir: dist
|
|
|
|
on:
|
|
|
|
branch: master
|
|
|
|
- stage: release
|
2019-04-14 15:22:30 +00:00
|
|
|
before_script:
|
|
|
|
- echo VUE_APP_DEBUG=1 > .env
|
2019-03-15 09:45:15 +00:00
|
|
|
script: npm run build
|
|
|
|
before_deploy:
|
2019-04-13 20:38:49 +00:00
|
|
|
- zip alerta-webui.zip -r dist/*
|
|
|
|
- tar cvfz alerta-webui.tar.gz dist/*
|
2019-03-07 10:37:00 +00:00
|
|
|
deploy:
|
|
|
|
- provider: releases
|
|
|
|
skip-cleanup: true
|
|
|
|
api_key: "$GITHUB_TOKEN"
|
|
|
|
file:
|
2019-04-13 20:38:49 +00:00
|
|
|
- alerta-webui.zip
|
|
|
|
- alerta-webui.tar.gz
|
2019-03-07 10:37:00 +00:00
|
|
|
on:
|
|
|
|
tags: true
|