Skip to content

CI/CD On Demand

CI/CD On Demand #7

Workflow file for this run

name: CI/CD
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build_test_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test
- name: Check if release version
id: check_version
run: node scripts/check_version.js
- name: Publish to npm
if: steps.check_version.outputs.is_release == 'true'
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}