Skip to content

Commit

Permalink
Refacto - publish NPM CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rhannachi committed Jul 27, 2023
1 parent 53d3362 commit 22b2722
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ jobs:
if: github.ref == 'refs/heads/main'
environment:
name: Production
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
CHROMATIC_PROJECT_TOKEN: ${{secrets.CHROMATIC_PROJECT_TOKEN}}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -300,17 +303,18 @@ jobs:
- name: unzip node_modules
run: tar -xzf node_modules.tar.gz

- name: Set deployment token
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"

- name: Publish to NPM
run: pnpm publish --access=public --no-git-checks
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Publish to Chromatic
id: chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ CHROMATIC_PROJECT_TOKEN }}
token: ${{ GITHUB_TOKEN }}
buildScriptName: build

- name: Publish Chromatic Summary
Expand Down
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
registry=https://registry.npmjs.org/:_authToken=${NPM_TOKEN}
registry=https://registry.npmjs.org

0 comments on commit 22b2722

Please sign in to comment.