[Issue 30] Fix error in CLI publish CI/CD (#75) #2
This file contains 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 - Publish @common-grants/cli | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "cli/**" # Trigger only if files in the `cli/` directory are changed | |
- ".github/workflows/cd-cli-npm.yml" | |
defaults: | |
run: | |
working-directory: ./cli | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
# Setup .npmrc file to publish to npm | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Run checks | |
run: npm run checks | |
- name: Publish to npm | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish --tag alpha --access public |