change: task resolution #37
Workflow file for this run
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: build and deploy | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: install dependencies | |
run: bun install | |
- name: check prettier | |
run: bun run prettier | |
- name: add prepatch version | |
run: pnpm version prepatch --preid="pr-$GITHUB_RUN_ID" --no-git-tag-version | |
if: github.event_name == 'pull_request' | |
- name: authenticate with npm | |
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: publish prerelease | |
run: pnpm publish --access public --no-git-checks --tag="pr-${{ github.event.number }}" | |
if: github.event_name == 'pull_request' | |
- name: publish | |
run: pnpm publish --access public --no-git-checks | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' |