Skip to content

Commit

Permalink
Refactor UUID mapping in deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Geczy committed Dec 30, 2023
1 parent e785ff0 commit 2a708eb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ jobs:
run: |
notify_coolify() {
local env_name=$1
local uuid_map=$2
local -n uuid_map=$2 # Use nameref for associative array
# 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
local package_name="${{ github.event.registry_package.name }}"
local UUID=${uuid_map[$package_name]}
# Check if UUID is empty
if [ -z "$UUID" ]; then
echo "UUID not found for package $package_name"
return 1
fi
# Notify Coolify
echo "Notifying Coolify for $env_name environment: $UUID"
Expand Down

0 comments on commit 2a708eb

Please sign in to comment.