Skip to content

Commit 748a0e3

Browse files
committed
CI/CD - npm publish on master push, dry-run on master pr
1 parent 6277023 commit 748a0e3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/node.js.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,16 @@ jobs:
2828
- run: xvfb-run --auto-servernum npm run test:chrome
2929
- run: xvfb-run --auto-servernum npm run test:firefox
3030

31+
- name: Publish to npm dry-run
32+
if: github.ref == 'refs/heads/master' && github.event_name == 'pull_request'
33+
env:
34+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36+
run: npm publish:dry-run
37+
3138
- name: Publish to npm
3239
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
3340
env:
34-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3543
run: npm publish

0 commit comments

Comments
 (0)