Skip to content

Commit 17630a1

Browse files
committed
Add publish to ci.yml
1 parent 3b9c9b0 commit 17630a1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,29 @@ jobs:
3434
env:
3535
INTERCOM_API_KEY: ${{ secrets.INTERCOM_API_KEY }}
3636

37+
publish:
38+
needs: [ compile, test ]
39+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repo
43+
uses: actions/checkout@v3
44+
- name: Set up node
45+
uses: actions/setup-node@v3
46+
- name: Install dependencies
47+
run: yarn install
48+
- name: Build
49+
run: yarn build
50+
51+
- name: Publish to npm
52+
run: |
53+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
54+
if [[ ${GITHUB_REF} == *alpha* ]]; then
55+
npm publish --access public --tag alpha
56+
elif [[ ${GITHUB_REF} == *beta* ]]; then
57+
npm publish --access public --tag beta
58+
else
59+
npm publish --access public
60+
fi
61+
env:
62+
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}

0 commit comments

Comments
 (0)