Skip to content

Update npm-publish-github-packages.yml #9

Update npm-publish-github-packages.yml

Update npm-publish-github-packages.yml #9

# 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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Stortbook Nuxt Package
on:
release:
types: [created]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 7
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node LTS ✨
uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: https://registry.npmjs.org
cache: pnpm
- name: Install dependencies 📦️
run: pnpm install --frozen-lockfile
- name: Build 🔨
run: pnpm build
- uses: simenandre/publish-with-pnpm@v1
with:
npm-auth-token: ${{ secrets.NPMJS_TOKEN }}