Skip to content

Commit ba27d0f

Browse files
authored
Merge pull request #81 from unicef/feature/update-yml-to-publish-to-npm
PR to add publish config to npm
2 parents ed28ea3 + 111a8fb commit ba27d0f

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

.github/workflows/nodejs.yml

+41-13
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,55 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [master]
99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111

1212
jobs:
1313
build:
14-
1514
runs-on: ubuntu-latest
1615

1716
strategy:
1817
matrix:
1918
node-version: [10.x, 12.x]
2019

2120
steps:
22-
- uses: actions/checkout@v2
23-
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v1
25-
with:
26-
node-version: ${{ matrix.node-version }}
27-
- run: npm ci
28-
- run: npm run build --if-present
29-
#- run: npm test
30-
env:
31-
CI: true
21+
- uses: actions/checkout@v2
22+
- name: Use Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
- run: npm ci
27+
- run: npm run build --if-present
28+
#- run: npm test
29+
env:
30+
CI: true
31+
32+
publish-npm:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: actions/setup-node@v1
38+
with:
39+
node-version: 10
40+
registry-url: https://registry.npmjs.org/
41+
- run: npm ci
42+
- run: pwd
43+
- run: npm publish --access=public
44+
env:
45+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
46+
47+
publish-gpr:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v2
52+
- uses: actions/setup-node@v1
53+
with:
54+
node-version: 12
55+
registry-url: https://npm.pkg.github.com/
56+
- run: npm ci
57+
- run: npm publish
58+
env:
59+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)