ci(workflows): added permission to write to pull requests #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install | |
uses: pnpm/action-setup@v4 | |
with: | |
version: latest | |
run_install: true | |
- name: Build | |
run: pnpm run tsc | |
- name: Assets | |
run: | | |
cp package.json dist/package.json | |
cp README.md dist/README.md | |
- name: Config | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
cd dist | |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
echo "registry=https://registry.npmjs.org/" >> ~/.npmrc | |
- name: Publish | |
run: | | |
cd dist | |
pnpm publish --access public --no-git-checks |