|
19 | 19 |
|
20 | 20 | name: Edgehog docs generation |
21 | 21 |
|
| 22 | +# publish Generate and publish docs on pushes on main (or release branches) only |
| 23 | +# when backend or frontend files are touched. |
22 | 24 | on: |
23 | | - push: |
24 | | - paths: |
25 | | - # Documentation pages |
26 | | - - "backend/docs/**" |
27 | | - # Schema files |
28 | | - - "backend/lib/edgehog_web/admin_api/**" |
29 | | - - "backend/lib/edgehog_web/schema.ex" |
30 | | - - "backend/lib/edgehog_web/schema/**" |
31 | | - # Ash resources, including new Ash domains |
32 | | - - "backend/lib/edgehog/**" |
33 | | - - "backend/mix.exs" |
34 | | - - "backend/mix.lock" |
35 | | - # SpectaQL configuration file |
36 | | - - "backend/.spectaql-config.yaml" |
37 | | - # The action itself, Elixir and Node.js versions |
38 | | - - ".tool-versions" |
39 | | - - ".github/workflows/docs-workflow.yaml" |
40 | | - branches: |
41 | | - # Create the snapshot only when it matters |
42 | | - - "main" |
43 | | - - "release-*" |
| 25 | + workflow_call: |
| 26 | + inputs: |
| 27 | + release-made: |
| 28 | + required: true |
| 29 | + type: boolean |
| 30 | + release-version: |
| 31 | + type: string |
44 | 32 |
|
45 | 33 | concurrency: |
46 | 34 | group: "${{ github.workflow }}-${{ github.ref }}" |
@@ -78,11 +66,17 @@ jobs: |
78 | 66 | repository: edgehog-device-manager/edgehog-astarte-interfaces |
79 | 67 | path: edgehog-astarte-interfaces |
80 | 68 | show-progress: false |
81 | | - - uses: .github/actions/gen-doc.yaml |
| 69 | + - name: Compute docs version |
| 70 | + id: compute-version |
| 71 | + run: | |
| 72 | + version=$(${{ inputs.release-made }} && echo ${{ inputs.release-version }} || echo "snapshot") |
| 73 | + echo "version=$version" >> $GITHUB_OUTPUT |
| 74 | + - uses: .github/actions/backend/gen-doc.yaml |
82 | 75 | with: |
83 | 76 | edgehog: edgehog |
84 | 77 | docs: docs |
85 | 78 | astarte-interfaces: edgehog-astarte-interfaces |
86 | | - - uses: .github/actions/publish-doc.yaml |
| 79 | + version: ${{ steps.compute-version.outputs.version }} |
| 80 | + - uses: .github/actions/backend/publish-doc.yaml |
87 | 81 | with: |
88 | 82 | docs: docs |
0 commit comments