mirror of
https://github.com/alerta/alerta-webui.git
synced 2025-03-17 14:02:37 +00:00
55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
language: node_js
|
|
node_js:
|
|
- 8
|
|
|
|
cache:
|
|
directories:
|
|
- node_modules
|
|
|
|
before_install:
|
|
- echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" >> .npmrc
|
|
install:
|
|
- npm install
|
|
|
|
stages:
|
|
- test
|
|
- name: deploy
|
|
if: type != pull_request AND branch = master
|
|
- release
|
|
|
|
jobs:
|
|
include:
|
|
- stage: test
|
|
script:
|
|
- npm run lint:nofix
|
|
- npm run test:unit
|
|
- stage: deploy
|
|
before_script:
|
|
- echo BASE_URL=./ > .env
|
|
- echo VUE_APP_ALERTA_ENDPOINT=https://alerta-api.herokuapp.com >> .env
|
|
- echo VUE_APP_TRACKING_ID=UA-44644195-7 >> .env
|
|
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
|
|
before_script:
|
|
- echo VUE_APP_DEBUG=1 > .env
|
|
script: npm run build
|
|
before_deploy:
|
|
- zip alerta-webui.zip -r dist/*
|
|
- tar cvfz alerta-webui.tar.gz dist/*
|
|
deploy:
|
|
- provider: releases
|
|
skip-cleanup: true
|
|
api_key: "$GITHUB_TOKEN"
|
|
file:
|
|
- alerta-webui.zip
|
|
- alerta-webui.tar.gz
|
|
on:
|
|
tags: true
|