Skip to content

github action

github action #6

Workflow file for this run

name: Node.js Package Release
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'admin/**'
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
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: 20
- name: Inject GitHub and npm tokens into .npmrc
run: |
sed -i "s/\${GH_TOKEN}/${{ secrets.GH_TOKEN }}/" .npmrc
sed -i "s/\${NPM_TOKEN}/${{ secrets.NPM_TOKEN }}/" .npmrc
- name: Publish to npm
run: npm publish
working-directory: ./admin
- name: Publish to GitHub Packages
run: npm publish --registry=https://npm.pkg.github.com/
working-directory: ./admin