|
1 | | -name: Create PR on Docs repo |
| 1 | +name: Upload code docs to TerminusCMS |
2 | 2 | on: |
3 | 3 | push: |
4 | | - paths: |
5 | | - - 'docs/api/**' |
6 | | - branches: |
7 | | - - main |
| 4 | + tags: |
| 5 | + - v* |
8 | 6 |
|
9 | 7 | jobs: |
10 | 8 | pull-request: |
11 | 9 | runs-on: ubuntu-latest |
12 | 10 | steps: |
13 | 11 | - name: Checkout |
14 | | - uses: actions/checkout@v2 |
15 | | - - name: Set BRANCH_NAME |
16 | | - run: echo "BRANCH_NAME=JS-Reference-Updates-$(date +%s)" >> $GITHUB_ENV |
17 | | - - name: Create pull request in terminusdb/terminusdb-docs |
18 | | - |
19 | | - env: |
20 | | - API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} |
21 | | - with: |
22 | | - source_folder: 'docs/api/.' |
23 | | - destination_repo: 'terminusdb/terminusdb-docs' |
24 | | - destination_folder: 'guides/reference-guides/javascript-client-reference' |
25 | | - destination_base_branch: 'main' |
26 | | - destination_head_branch: ${{ env.BRANCH_NAME }} |
27 | | - |
28 | | - user_name: 'Neelterminusdb' |
29 | | - pull_request_reviewers: 'mark-terminusdb' |
| 12 | + uses: actions/checkout@v3 |
| 13 | + - name: Clone JSDoc template |
| 14 | + run: git clone https://github.com/terminusdb-labs/jsdoc-terminusdb-template.git |
| 15 | + - name: Run NPM Install |
| 16 | + run: npm i |
| 17 | + - name: Run JSDoc |
| 18 | + run: npx jsdoc --template ./jsdoc-terminusdb-template --recurse ./lib/ > docs.json || true |
| 19 | + - name: Upload to TerminusCMS |
| 20 | + run: | |
| 21 | + curl -H 'Authorization: Token ${{ secrets.TERMINUSCMS_TOKEN}}' \ |
| 22 | + -H 'Content-Type: application/json' \ |
| 23 | + '${{ secrets.TERMINUSCMS_URL}}' -d @./docs.json |
0 commit comments