diff --git a/.github/workflows/builder.yml b/.github/workflows/builder.yml index b24217b02..d5eb9d04d 100644 --- a/.github/workflows/builder.yml +++ b/.github/workflows/builder.yml @@ -10,15 +10,17 @@ jobs: environment: prod permissions: packages: write + env: + IMAGES: "twitch_chat twitch_events steam dota" steps: - uses: actions/checkout@v4 # Step 1: Fetch current image manifests - name: Fetch current manifests run: | - IMAGES=("twitch-chat" "twitch-events" "steam" "dota") - for IMAGE in "${IMAGES[@]}"; do - MANIFEST=$(curl -s -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GHA_READ_PKG }}" "https://ghcr.io/v2/dotabod/$IMAGE/manifests/v2.1") + for IMAGE in $IMAGES; do + IMAGE_NAME=$(echo "$IMAGE" | sed 's/_/-/g') # Replace underscores with hyphens for the actual image names + MANIFEST=$(curl -s -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GHA_READ_PKG }}" "https://ghcr.io/v2/dotabod/$IMAGE_NAME/manifests/v2.1") echo "OLD_${IMAGE^^}_MANIFEST=$MANIFEST" >> $GITHUB_ENV done @@ -45,9 +47,9 @@ jobs: id: check_updates run: | UPDATED_IMAGES="" - IMAGES=("twitch-chat" "twitch-events" "steam" "dota") - for IMAGE in "${IMAGES[@]}"; do - NEW_MANIFEST=$(curl -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GHA_READ_PKG }}" "https://ghcr.io/v2/dotabod/$IMAGE/manifests/v2.1") + for IMAGE in $IMAGES; do + IMAGE_NAME=$(echo "$IMAGE" | sed 's/_/-/g') # Replace underscores with hyphens for the actual image names + NEW_MANIFEST=$(curl -H "Accept: application/vnd.oci.image.index.v1+json" -H "Authorization: Bearer ${{ secrets.GHA_READ_PKG }}" "https://ghcr.io/v2/dotabod/$IMAGE_NAME/manifests/v2.1") OLD_MANIFEST_VAR="OLD_${IMAGE^^}_MANIFEST" # Compare manifests (e.g., using digests or other relevant data) # Echo the new_manifest for debug pruposes to the github env for each image @@ -66,8 +68,8 @@ jobs: # Map package name to UUID case $IMAGE in "dota") UUID="esgckgc" ;; - "twitch-events") UUID="aopskdk" ;; - "twitch-chat") UUID="gahgag" ;; + "twitch_events") UUID="aopskdk" ;; + "twitch_chat") UUID="gahgag" ;; "steam") UUID="asldja" ;; esac curl -X GET -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" "https://${{ secrets.COOLIFY_HOST }}/api/v1/deploy?uuid=${UUID}&force=false"