publish_docs.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Publish Docs to NPM
  2. on:
  3. push:
  4. branches:
  5. - master
  6. paths:
  7. - 'docs/**'
  8. workflow_dispatch:
  9. inputs:
  10. branch:
  11. description: 'Branch to publish from'
  12. required: true
  13. default: 'master'
  14. type: string
  15. jobs:
  16. publish:
  17. runs-on: ubuntu-latest
  18. permissions:
  19. contents: read
  20. id-token: write
  21. defaults:
  22. run:
  23. working-directory: docs
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@v4
  27. with:
  28. ref: ${{ inputs.branch || github.ref }}
  29. - name: Setup Node.js
  30. uses: actions/setup-node@v6
  31. with:
  32. node-version: '24.x'
  33. registry-url: 'https://registry.npmjs.org'
  34. - name: Update npm
  35. run: npm install -g npm@latest
  36. - name: Install dependencies
  37. run: npm install
  38. - name: Build
  39. run: npm run build
  40. - name: Generate timestamp version
  41. id: version
  42. run: echo "version=0.0.0-$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT
  43. - name: Set package version
  44. run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version
  45. - name: Publish to NPM
  46. run: npm publish --access public