Release to Coolify #196
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release to Coolify | |
on: | |
registry_package: | |
types: [published] | |
jobs: | |
release: | |
if: ${{ github.event.registry_package.package_version.container_metadata.labels.description != '' }} | |
runs-on: ubuntu-latest | |
environment: prod | |
steps: | |
- name: "Release to Prod and Dev" | |
run: | | |
notify_coolify() { | |
local env_name=$1 | |
local uuid_map=$2 | |
# Map package name to UUID | |
case "${{ github.event.registry_package.name }}" in | |
"dota") UUID=${uuid_map["dota"]} ;; | |
"twitch-events") UUID=${uuid_map["twitch-events"]} ;; | |
"twitch-chat") UUID=${uuid_map["twitch-chat"]} ;; | |
"steam") UUID=${uuid_map["steam"]} ;; | |
esac | |
# Notify Coolify | |
echo "Notifying Coolify for $env_name environment: $UUID" | |
curl -s -X GET -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" "https://${{ secrets.COOLIFY_HOST }}/api/v1/deploy?uuid=${UUID}&force=false" | |
} | |
# UUID mappings for prod and dev | |
declare -A prod_uuids=( ["dota"]="i8gccg8" ["twitch-events"]="zwg4g4c" ["twitch-chat"]="zwgkg48" ["steam"]="wsgwk8s" ) | |
declare -A dev_uuids=( ["dota"]="esgckgc" ["twitch-events"]="kkk04os" ["twitch-chat"]="qgosw80" ["steam"]="q88g0c8" ) | |
# Notify for prod and dev | |
notify_coolify "Prod" prod_uuids | |
notify_coolify "Dev" dev_uuids |