Skip to content

Node.js Package Release #19

Node.js Package Release

Node.js Package Release #19

Workflow file for this run

name: Node.js Package Release
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'admin/package.json'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 20
- name: Install dependencies
run: npm install
working-directory: ./admin
publish:
needs: build
if: needs.check_version.outputs.version_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 20
- name: Configure npm for npm registry
run: |
echo "@pleasure1234:registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
working-directory: ./admin
- name: Publish to npm
run: npm publish
working-directory: ./admin
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Configure npm for GitHub Packages
run: |
echo "@Pleasurecruise:registry=https://npm.pkg.github.com/" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" >> .npmrc
working-directory: ./admin
- name: Publish to GitHub Packages
run: npm publish --registry=https://npm.pkg.github.com/
working-directory: ./admin
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}