-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.09 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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'