| 1 | name: Detect a g1t.page project |
| 2 | description: Says what a g1t.page build of this checkout would find, without building anything. Its kind and framework, how it installs, what builds it and where its output is. |
| 3 | author: g1t |
| 4 | |
| 5 | inputs: |
| 6 | root-dir: |
| 7 | description: Where the project is in the checkout. The checkout itself unless you say. |
| 8 | required: false |
| 9 | default: "" |
| 10 | build-command: |
| 11 | description: A build command of your own, as g1t/deploy takes it. |
| 12 | required: false |
| 13 | default: "" |
| 14 | output-dir: |
| 15 | description: An output folder of your own, as g1t/deploy takes it. |
| 16 | required: false |
| 17 | default: "" |
| 18 | |
| 19 | outputs: |
| 20 | kind: |
| 21 | description: workers (a Wrangler config, or a framework's Cloudflare adapter), static (a site a build writes), html (the files as they are) or none (nothing to serve, or a framework set up to need a server). |
| 22 | value: ${{ steps.detect.outputs.kind }} |
| 23 | install: |
| 24 | description: How its dependencies are installed, such as npm ci. Empty without a package.json. |
| 25 | value: ${{ steps.detect.outputs.install }} |
| 26 | build: |
| 27 | description: What builds it. Empty when nothing does. |
| 28 | value: ${{ steps.detect.outputs.build }} |
| 29 | output-dir: |
| 30 | description: The folder that is served, relative to the project (. for the project itself). Empty when a build has yet to write it. |
| 31 | value: ${{ steps.detect.outputs.output-dir }} |
| 32 | framework: |
| 33 | description: The framework it is built with, such as vite, astro, nextjs, sveltekit or hugo. Empty when there is none. |
| 34 | value: ${{ steps.detect.outputs.framework }} |
| 35 | |
| 36 | runs: |
| 37 | using: composite |
| 38 | steps: |
| 39 | - id: detect |
| 40 | shell: bash |
| 41 | env: |
| 42 | ROOT_DIR: ${{ inputs.root-dir }} |
| 43 | BUILD_COMMAND: ${{ inputs.build-command }} |
| 44 | OUTPUT_DIR: ${{ inputs.output-dir }} |
| 45 | run: | |
| 46 | set -euo pipefail |
| 47 | runner="$(bash "$GITHUB_ACTION_PATH/runner.sh")" |
| 48 | found="$("$runner" detect)" |
| 49 | echo "$found" |
| 50 | echo "$found" >> "$GITHUB_OUTPUT" |