Skip to content

Commit 0fe354b

Browse files
RDM-8661: Added github actions for the branch
1 parent accd252 commit 0fe354b

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/npmpublish.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Node.js Package
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 2.64.5-EUI-CCD
7+
push:
8+
branches:
9+
- 2.64.5-EUI-CCD
10+
- refs/tags/*
11+
tags:
12+
- '*'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v1
19+
- uses: actions/setup-node@v1
20+
with:
21+
node-version: 10
22+
- run: yarn install
23+
- run: yarn build
24+
- run: yarn test
25+
26+
publish-npm:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v1
31+
if: startsWith(github.ref, 'refs/tags')
32+
- uses: actions/setup-node@v1
33+
if: startsWith(github.ref, 'refs/tags')
34+
with:
35+
node-version: 10
36+
registry-url: https://registry.npmjs.org/
37+
- run: yarn install && yarn build && yarn publish
38+
if: startsWith(github.ref, 'refs/tags')
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_API_TOKEN }}
41+
42+
publish-gpr:
43+
needs: build
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v1
47+
if: startsWith(github.ref, 'refs/tags')
48+
- uses: actions/setup-node@v1
49+
if: startsWith(github.ref, 'refs/tags')
50+
with:
51+
node-version: 10
52+
registry-url: https://npm.pkg.github.com/
53+
scope: '@hmcts'
54+
- run: yarn install && yarn build && yarn publish
55+
if: startsWith(github.ref, 'refs/tags')
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)