Skip to content

Fixed vulnerabilities in dependencies #24

Fixed vulnerabilities in dependencies

Fixed vulnerabilities in dependencies #24

# 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: Node.js Package
on:
pull_request:
release:
types: [created]
jobs:
build:
if: ${{ github.event_name != 'release' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm ci --force
- run: npm run build
publish-npm:
if: ${{ github.event_name == 'release' }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm ci --force
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.PUBLISH_NPM_TOKEN}}
publish-gpr:
if: ${{ github.event_name == 'release' }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://npm.pkg.github.com/
cache: 'npm'
cache-dependency-path: package-lock.json
scope: "@alepiumetti"
- run: npm ci --force
- name: Update package.json name
run: sed -i '2,2 s/table-pagination-chakra-ui/@alepiumetti\/table-pagination-chakra-ui/g' package.json
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}}