Skip to content

Node-CI

Node-CI #63

Workflow file for this run

name: Node-CI
on: [push, pull_request, create]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 13.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: npm ci
env:
CI: true
- name: npm build
run: npm run build --if-present
env:
CI: true
- name: npm test
run: npm test
env:
CI: true
publish-npm:
if: github.repository == 'Supereg/homebridge-http-switch' && github.event_name == 'create' && startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}