Skip to content

CI/CD On Demand

CI/CD On Demand #6

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@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- 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: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}