Skip to content

Commit

Permalink
fix: add npm publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanenkoStud committed Nov 1, 2023
1 parent 768f05b commit a4a59ee
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

env:
# Setting an environment variable with the value of a configuration variable
npm_token: ${{ vars.NPM_TOKEN }}

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
Expand Down Expand Up @@ -76,6 +80,18 @@ jobs:
name: main-dist
path: ./packages/kite-chat-docs/dist/

- name: Upload Kite Chat Component Artifact
uses: actions/upload-artifact@v3
with:
name: kite-chat-component
path: ./packages/kite-chat-component

- name: Upload Kite Chat Artifact
uses: actions/upload-artifact@v3
with:
name: kite-chat
path: ./packages/kite-chat

build_test:
needs: build_main
runs-on: ubuntu-latest
Expand Down Expand Up @@ -150,6 +166,36 @@ jobs:
with:
path: ./packages/kite-chat-docs/dist/

publish_kite_chat_component:
needs: build_main
runs-on: ubuntu-latest
if: github.event.ref == 'refs/heads/main'
steps:
- name: Restore Kite Chat Component Package
uses: actions/download-artifact@v3
with:
name: kite-chat-component
path: ./packages/kite-chat-component
- name: Publish Kite Chat Component
run: |
echo "//registry.npmjs.org/:_authToken=${{ env.npm_token }}" > ~/.npmrc
npm publish --access public -w @pragmasoft-ukraine/kite-chat-component
publish_kite_chat:
needs: build_main
runs-on: ubuntu-latest
if: github.event.ref == 'refs/heads/main'
steps:
- name: Restore Kite Chat Package
uses: actions/download-artifact@v3
with:
name: kite-chat
path: ./packages/kite-chat
- name: Publish Kite Chat
run: |
echo "//registry.npmjs.org/:_authToken=${{ env.npm_token }}" > ~/.npmrc
npm publish --access public -w @pragmasoft-ukraine/kite-chat
deploy:
needs: [build_main, build_test]
runs-on: ubuntu-latest
Expand Down

0 comments on commit a4a59ee

Please sign in to comment.