Fix Rollup dependency issue in GitHub Actions workflows #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CD | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| build-test-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Clean install | |
| run: | | |
| rm -rf node_modules package-lock.json | |
| npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Run checks (linting, type-checking, formatting) | |
| run: npm run check | |
| - name: Run tests | |
| run: npm run test | |
| - name: Publish package to npm | |
| if: ${{ vars.ENVIRONMENT == 'prod' }} | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |