Skip to content

Commit

Permalink
Update npm-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstech authored Apr 22, 2022
1 parent 0d1c5b0 commit 4723a83
Showing 1 changed file with 17 additions and 37 deletions.
54 changes: 17 additions & 37 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
# 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: Node.js Package

name: Publish package to GitHub Packages
on:
push:
# Sequence of patterns matched against refs/heads
branches:
# Push events on main branch
- master

release:
types: [created]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

- name: Install and Build 🔧
run: |
npm install
npm run build
- name: Deploy 🚀
uses: JamesIves/[email protected]
- uses: actions/checkout@v3
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
with:
branch: gh-pages # The branch the action should deploy to.
folder: demo/dist # The folder the action should deploy.

publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@win11react'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.BOT }}

0 comments on commit 4723a83

Please sign in to comment.