Extract NPM deployment out to different workflow
This will allow us to limit what branches it runs on.
This commit is contained in:
parent
82c51a319c
commit
748d279107
57
.github/workflows/deploy.yml
vendored
Normal file
57
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: Package Deployment
|
||||
|
||||
on:
|
||||
push: ~
|
||||
# branches:
|
||||
# - develop
|
||||
# - master
|
||||
release: ~
|
||||
|
||||
jobs:
|
||||
deploy_github:
|
||||
name: GitHub Package Registry
|
||||
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 (release)
|
||||
if: github.event_name == 'release'
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
- name: Deploy (release candidate)
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
npm --no-git-tag-version version prerelease
|
||||
npm publish --tag next
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
deploy_npm:
|
||||
name: NPM
|
||||
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}}
|
51
.github/workflows/main.yml
vendored
51
.github/workflows/main.yml
vendored
@ -1,6 +1,6 @@
|
||||
name: CI
|
||||
|
||||
on: [push, pull_request, release]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
linting:
|
||||
@ -42,52 +42,3 @@ jobs:
|
||||
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 (release)
|
||||
if: github.event_name == 'release'
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
- name: Deploy (release candidate)
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
npm --no-git-tag-version version prerelease
|
||||
npm publish --tag next
|
||||
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}}
|
||||
|
Loading…
Reference in New Issue
Block a user