| 1 | name: Deploy website |
| 2 | description: Request API reference publication and deployment from the website repository. |
| 3 | inputs: |
| 4 | channel: |
| 5 | description: API reference channel that was published |
| 6 | required: true |
| 7 | dispatch-token: |
| 8 | description: Token with permission to dispatch workflows in Effect-TS/website |
| 9 | required: true |
| 10 | revision: |
| 11 | description: Full Git commit SHA that was published |
| 12 | required: true |
| 13 | |
| 14 | runs: |
| 15 | using: composite |
| 16 | steps: |
| 17 | - name: Request website API reference publication |
| 18 | shell: bash |
| 19 | env: |
| 20 | CHANNEL: ${{ inputs.channel }} |
| 21 | GH_TOKEN: ${{ inputs.dispatch-token }} |
| 22 | REVISION: ${{ inputs.revision }} |
| 23 | run: | |
| 24 | if [[ ! "$CHANNEL" =~ ^v[34]$ || ! "$REVISION" =~ ^[a-f0-9]{40}$ ]]; then |
| 25 | echo "::error::Website deployment requires channel v3 or v4 and a full Git commit SHA" |
| 26 | exit 1 |
| 27 | fi |
| 28 | |
| 29 | jq -n \ |
| 30 | --arg channel "$CHANNEL" \ |
| 31 | --arg revision "$REVISION" \ |
| 32 | '{ |
| 33 | event_type: "publish-api-reference", |
| 34 | client_payload: { |
| 35 | repository: "Effect-TS/effect", |
| 36 | channel: $channel, |
| 37 | revision: $revision |
| 38 | } |
| 39 | }' | |
| 40 | gh api --method POST repos/Effect-TS/website/dispatches --input - |