Skip to content

Deploy

Deploy #18

Workflow file for this run

name: Deploy
on: workflow_dispatch
jobs:
publish-npm:
name: Publish to NPM
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.74
- name: Install dependencies
run: pnpm --color install
- name: Build
run: pnpm build
- name: Read version from package.json
run: |
VERSION=$(node -p "require('./package.json').version")
echo "version=$VERSION" >> $GITHUB_ENV
- name: Create Git tag
run: |
git tag ${{ env.version }}
git push origin ${{ env.version }}
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v3
with:
access: public
token: ${{ secrets.NPM_TOKEN }}