Skip to content

Create npm-publish.yml #1

Create npm-publish.yml

Create npm-publish.yml #1

Workflow file for this run

# 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 CI/CD
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Navigate to server subdirectory
run: cd x-clone-backend
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm test
- run: pm2 restart backendserver
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}