-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
60 lines (55 loc) · 1.57 KB
/
Copy pathaction.yml
File metadata and controls
60 lines (55 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: "Build Docs with Sourcey"
description: "Build static documentation from OpenAPI specs and markdown using Sourcey"
branding:
icon: "book-open"
color: "blue"
inputs:
version:
description: "Sourcey version to install"
required: false
default: "latest"
config:
description: "Path to sourcey.config.ts (default: auto-detect)"
required: false
spec:
description: "Path to OpenAPI spec file (for standalone builds without config)"
required: false
output:
description: "Output directory"
required: false
default: "docs"
args:
description: "Additional arguments to pass to sourcey build"
required: false
outputs:
output-dir:
description: "Path to the generated documentation"
value: ${{ steps.build.outputs.output-dir }}
runs:
using: "composite"
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Sourcey
shell: bash
run: npm install -g sourcey@${{ inputs.version }}
- name: Build docs
id: build
shell: bash
run: |
ARGS=""
if [ -n "${{ inputs.config }}" ]; then
ARGS="--config ${{ inputs.config }}"
elif [ -n "${{ inputs.spec }}" ]; then
ARGS="${{ inputs.spec }}"
fi
if [ -n "${{ inputs.output }}" ]; then
ARGS="$ARGS --output ${{ inputs.output }}"
fi
if [ -n "${{ inputs.args }}" ]; then
ARGS="$ARGS ${{ inputs.args }}"
fi
sourcey build $ARGS
echo "output-dir=${{ inputs.output }}" >> "$GITHUB_OUTPUT"