Skip to content

💚 Re-fix it

💚 Re-fix it #120

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: NPM Package
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
container: alpine:latest
steps:
- uses: actions/checkout@v4
# Install Pnpm & Node
- name: Install Pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
# Install dependencies with pnpm
- name: Install Dependencies
run: pnpm install
# build & test
- name: Build
run: npm run build # TODO: Change "build" to "test" when tests are ready
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: build
steps:
# setup git config (for auto-version bumping)
- name: Setup git config
run: |
git config user.name "GitHub actions"
git config user.email "<>"
# deploy to npm
- name: Deploy
run: npm run deploy
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}