publish_docs.yml 1.1 KB

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