1
0
mirror of synced 2024-11-22 13:06:08 +03:00
select2/.github/workflows/main.yml
Kevin Brown 91838fe0a6 Add deploying to GPM and NPM
This also adds a handler for the release event, which is what we want to be using for pushing NPM builds out.
2019-09-10 20:07:35 -04:00

87 lines
2.2 KiB
YAML

name: CI
on: [push, pull_request, release]
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 8
uses: actions/setup-node@v1
with:
node-version: 8
- name: npm install
run: npm install
- name: Run linting
run: grunt compile lint
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 8
uses: actions/setup-node@v1
with:
node-version: 8
- name: npm install
run: npm install
- name: Run tests
run: grunt compile test
minification:
name: Minification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 8
uses: actions/setup-node@v1
with:
node-version: 8
- name: npm install
run: npm install
- name: Run minification
run: grunt compile minify
deploy_github:
name: Deploy to GitHub Package Registry
needs: [linting, tests, minification]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 8
uses: actions/setup-node@v1
with:
node-version: 8
registry-url: https://npm.pkg.github.com/
scope: '@select2'
- name: npm install
run: npm install
- name: Run linting, tests, minify
run: grunt
- name: Deploy
if: github.event_name == 'push'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
deploy_npm:
name: Deploy to NPM
needs: [linting, tests, minification]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 8
uses: actions/setup-node@v1
with:
node-version: 8
registry-url: https://npm.pkg.github.com/
scope: '@select2'
- name: npm install
run: npm install
- name: Run linting, tests, minify
run: grunt
- name: Deploy
if: github.event_name == 'release'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}