Skip to content

Commit

Permalink
Add publish to ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Swimburger committed Dec 20, 2024
1 parent 3b9c9b0 commit 17630a1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,29 @@ jobs:
env:
INTERCOM_API_KEY: ${{ secrets.INTERCOM_API_KEY }}

publish:
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
if [[ ${GITHUB_REF} == *alpha* ]]; then
npm publish --access public --tag alpha
elif [[ ${GITHUB_REF} == *beta* ]]; then
npm publish --access public --tag beta
else
npm publish --access public
fi
env:
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}

0 comments on commit 17630a1

Please sign in to comment.