Skip to content

Commit

Permalink
workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
krajncdev committed Aug 13, 2024
1 parent a2a5fc3 commit 4fbbffb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 33 deletions.
50 changes: 20 additions & 30 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,33 @@
# 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

on:
push:
# Sequence of patterns matched against refs/heads
branches:
# Push events on main branch
- master
release:
types: [created]

jobs:
build-and-deploy:
build:
runs-on: ubuntu-latest
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@v4
- uses: actions/setup-node@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: demo/dist # The folder the action should deploy.

publish-npm:
node-version: 16
- run: npm ci
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "12.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,5 @@
"directories": {
"lib": "lib",
"test": "tests"
},
"publishConfig": {
"@krajncdev:registry": "https://npm.pkg.github.com"
}
}

0 comments on commit 4fbbffb

Please sign in to comment.