Files
gy/action.yml
2026-10-24 05:41:56 -04:00

79 lines
2.2 KiB
YAML

name: Ghaymah Deploy
description: Deploy your project to Ghaymah with `gy deploy`
author: ghaymah
branding:
icon: rocket
color: purple
inputs:
token:
description: 'Ghaymah access token (create one in the dashboard)'
required: true
api-url:
description: 'Ghaymah gateway URL'
required: false
default: 'https://gateway.ghaymah.systems'
name:
description: 'App name (defaults to the repo name)'
required: false
port:
description: 'HTTP port the app listens on'
required: false
strategy:
description: 'Build strategy: auto, dockerfile, or buildpacks'
required: false
gy-version:
description: 'gy CLI version to install'
required: false
default: 'latest'
wait:
description: 'Wait for the deployment to go live'
required: false
default: 'true'
outputs:
url:
description: 'The deployed app URL'
value: ${{ steps.deploy.outputs.url }}
build_id:
description: 'The build id'
value: ${{ steps.deploy.outputs.build_id }}
status:
description: 'Final build status'
value: ${{ steps.deploy.outputs.status }}
runs:
using: composite
steps:
- name: Install gy
shell: bash
run: curl -fsSL https://install.ghaymah.systems | sh
- name: Deploy
id: deploy
shell: bash
env:
GY_TOKEN: ${{ inputs.token }}
GY_API_URL: ${{ inputs.api-url }}
run: |
ARGS="gy deploy --json"
[ -n "${{ inputs.name }}" ] && ARGS="$ARGS --name '${{ inputs.name }}'"
[ -n "${{ inputs.port }}" ] && ARGS="$ARGS --port ${{ inputs.port }}"
[ -n "${{ inputs.strategy }}" ] && ARGS="$ARGS --strategy ${{ inputs.strategy }}"
OUT=$(eval "$ARGS")
printf '%s\n' "$OUT"
url=$(printf '%s\n' "$OUT" | jq -r '.app_url // empty')
build_id=$(printf '%s\n' "$OUT" | jq -r '.build_id // empty')
status=$(printf '%s\n' "$OUT" | jq -r '.status // "failed"')
echo "url=$url" >> "$GITHUB_OUTPUT"
echo "build_id=$build_id" >> "$GITHUB_OUTPUT"
echo "status=$status" >> "$GITHUB_OUTPUT"
if [ "$status" != "succeeded" ]; then
echo "::error::deploy failed ($status)"
exit 1
fi
echo "::notice::✅ live at $url"