Skip to content

chore: migrate travis to github #1

chore: migrate travis to github

chore: migrate travis to github #1

Workflow file for this run

name: Node.js CI
on:
push:
branches: [master]
tags:
- '*'
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
node-version: [11.x, 12.x, 13.x, 14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Build
run: npm run build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
- name: npm publish
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}