Skip to content

Commit

Permalink
Allow to only publish the doc on gh-pages without deploying to npm (#490
Browse files Browse the repository at this point in the history
)

For that, the 'doconly' keyword can be used instead of a version number
in the release workflow.
  • Loading branch information
divdavem committed Jan 8, 2024
1 parent fa786e9 commit 8615da4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20.x # current LTS
cache: npm

- name: Install dependencies
run: npm ci
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- name: npm version
run: |
- run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
npm version ${{ inputs.version }}
- run: npm version ${{ inputs.version }}
if: inputs.version != 'doconly'
- run: git show HEAD
- name: npm login
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- run: |
npm whoami
- run: npm publish --access=public
npm publish --access=public
if: inputs.version != 'doconly'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push origin master v${{ inputs.version }}
if: inputs.version != 'doconly'
- name: Fetching gh-pages branch
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 8615da4

Please sign in to comment.