diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index ffad9b3..1c26624 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -4,7 +4,10 @@ name: Node.js CI -on: [push] +on: + push: + pull_request: + branches: [ master ] jobs: build: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index eecf3c2..2e1c8f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,32 +1,26 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# This workflow will do a clean install of node dependencies and publishes via npm # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js Publish CI on: - push: - branches: [ master ] pull_request: + types: [ closed ] branches: [ master ] jobs: build: - + if: github.event.pull_request.merged == true runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x, 18.x, 20.x] - steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: 20.x registry-url: 'https://registry.npmjs.org' - run: npm install - - run: npm test env: CI: true - run: npm publish