Last active
July 4, 2020 18:06
-
-
Save constgen/7e84de3a5042ad5a93b75dc16adb1d69 to your computer and use it in GitHub Desktop.
GitHub Action for NPM publishing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
registry-url: https://registry.npmjs.org/ | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Tests | |
run: npm test | |
- name: Publish to NPM | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: npm publish |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Tests | |
run: npm test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment