|
| 1 | +name: Generate Docs |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +jobs: |
| 18 | + generate: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + include: |
| 23 | + - target: man-page |
| 24 | + input: './node/doc/api/cli.md' |
| 25 | + - target: addon-verify |
| 26 | + input: './node/doc/api/addons.md' |
| 27 | + - target: api-links |
| 28 | + input: './node/lib/*.js' |
| 29 | + - target: orama-db |
| 30 | + input: './node/doc/api/*.md' |
| 31 | + - target: json-simple |
| 32 | + input: './node/doc/api/*.md' |
| 33 | + - target: legacy-json |
| 34 | + input: './node/doc/api/*.md' |
| 35 | + - target: legacy-html |
| 36 | + input: './node/doc/api/*.md' |
| 37 | + - target: llms-txt |
| 38 | + input: './node/doc/api/*.md' |
| 39 | + fail-fast: false |
| 40 | + |
| 41 | + steps: |
| 42 | + - name: Harden Runner |
| 43 | + uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2 |
| 44 | + with: |
| 45 | + egress-policy: audit |
| 46 | + |
| 47 | + - name: Git Checkout |
| 48 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 49 | + with: |
| 50 | + persist-credentials: false |
| 51 | + |
| 52 | + - name: Git Checkout |
| 53 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 54 | + with: |
| 55 | + persist-credentials: false |
| 56 | + repository: nodejs/node |
| 57 | + path: node |
| 58 | + |
| 59 | + - name: Setup Node.js |
| 60 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 61 | + with: |
| 62 | + node-version-file: '.nvmrc' |
| 63 | + cache: 'npm' |
| 64 | + |
| 65 | + - name: Install dependencies |
| 66 | + run: npm ci |
| 67 | + |
| 68 | + - name: Create output directory |
| 69 | + run: mkdir -p out/${{ matrix.target }} |
| 70 | + |
| 71 | + - name: Generate ${{ matrix.target }} |
| 72 | + run: | |
| 73 | + node bin/cli.mjs generate \ |
| 74 | + -t ${{ matrix.target }} \ |
| 75 | + -i "${{ matrix.input }}" \ |
| 76 | + -o "out/${{ matrix.target }}" \ |
| 77 | + --index ./node/doc/api/index.md \ |
| 78 | + --skip-lint |
| 79 | +
|
| 80 | + - name: Upload ${{ matrix.target }} artifacts |
| 81 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 82 | + with: |
| 83 | + name: ${{ matrix.target }}-${{ github.run_id }} |
| 84 | + path: out/${{ matrix.target }} |
0 commit comments