Skip to content

Commit 906dbf2

Browse files
committed
ci(release): add deploy job
Ref: #65 Signed-off-by: Philip Gerke <me@philipgerke.com>
1 parent 2503e49 commit 906dbf2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,35 @@ jobs:
4141
prerelease: ${{ contains(steps.extract_version.outputs.version, '-') }}
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
deploy:
46+
name: Deploy Library
47+
runs-on: ubuntu-latest
48+
needs: [check_release_trigger]
49+
if: ${{ needs.check_release_trigger.outputs.version_changed == 'true' && !contains(github.event.head_commit.message, '[skip deploy]') }}
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
- name: Setup Node.js
54+
uses: actions/setup-node@v4
55+
with:
56+
node-version: lts/*
57+
- name: Setup pnpm
58+
uses: pnpm/action-setup@v4
59+
- name: Restore pnpm store
60+
uses: actions/cache@v4
61+
with:
62+
path: ${{ needs.cache_dependencies.outputs.pnpm-store-path }}
63+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
64+
restore-keys: |
65+
${{ runner.os }}-pnpm-store-
66+
- name: Restore dependencies
67+
run: pnpm install --frozen-lockfile
68+
- name: Build for production
69+
run: pnpm run build
70+
- name: Publish to npmjs.org
71+
run: |
72+
pnpm publish ./dist --access public --tag latest;
73+
env:
74+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
75+
NPM_CONFIG_PROVENANCE: true

0 commit comments

Comments
 (0)