deploy.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Package Deployment
  2. on:
  3. push:
  4. branches:
  5. - develop
  6. - master
  7. release: ~
  8. jobs:
  9. deploy_github:
  10. name: GitHub Package Registry
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v1
  14. - name: Use Node.js 8
  15. uses: actions/setup-node@v1
  16. with:
  17. node-version: 8
  18. registry-url: https://npm.pkg.github.com/
  19. scope: '@select2'
  20. - name: npm install
  21. run: npm install
  22. - name: Run linting, tests, minify
  23. run: grunt
  24. - name: Deploy (release)
  25. if: github.event_name == 'release'
  26. run: npm publish
  27. env:
  28. NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
  29. - name: Deploy (release candidate)
  30. if: github.event_name == 'push'
  31. run: |
  32. npm --no-git-tag-version version prerelease
  33. npm publish --tag next
  34. env:
  35. NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
  36. deploy_npm:
  37. name: NPM
  38. runs-on: ubuntu-latest
  39. steps:
  40. - uses: actions/checkout@v1
  41. - name: Use Node.js 8
  42. uses: actions/setup-node@v1
  43. with:
  44. node-version: 8
  45. registry-url: https://npm.pkg.github.com/
  46. scope: '@select2'
  47. - name: npm install
  48. run: npm install
  49. - name: Run linting, tests, minify
  50. run: grunt
  51. - name: Deploy
  52. if: github.event_name == 'release'
  53. run: npm publish
  54. env:
  55. NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}