mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-04-27 21:40:28 -04:00
51 lines
925 B
YAML
51 lines
925 B
YAML
name: CI
|
|
|
|
on:
|
|
- push
|
|
- pull_request
|
|
|
|
env:
|
|
FORCE_COLOR: 2
|
|
|
|
jobs:
|
|
test:
|
|
name: Node ${{ matrix.node }}
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node: [10, 12, 14, 16]
|
|
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
publish:
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 14
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
- name: Publish on npm
|
|
run: npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|