Skip to content

Commit

Permalink
Remove unnecessary steps and actions from builder
Browse files Browse the repository at this point in the history
workflow
  • Loading branch information
Geczy committed Dec 27, 2023
1 parent 9efdb49 commit 08c0bec
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Fetch current manifests
run: |
for IMAGE in $IMAGES; do
IMAGE_NAME=$(echo "$IMAGE" | sed 's/_/-/g')
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/tags/list")
echo "OLD_${IMAGE^^}_MANIFEST=$MANIFEST" >> $GITHUB_ENV
done
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr
Expand All @@ -40,36 +32,3 @@ jobs:
provenance: false
set: |
*.platform=linux/arm64
- name: Check for updated images
id: check_updates
run: |
UPDATED_IMAGES=""
for IMAGE in $IMAGES; do
IMAGE_NAME=$(echo "$IMAGE" | sed 's/_/-/g')
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/tags/list")
OLD_MANIFEST_VAR="OLD_${IMAGE^^}_MANIFEST"
# Echo the new_manifest for debug purposes to the github env for each image
echo "NEW_${IMAGE^^}_MANIFEST=$NEW_MANIFEST" >> $GITHUB_ENV
# Trim both new and old manifests from whitespace
NEW_MANIFEST=$(echo "$NEW_MANIFEST" | tr -d '[:space:]' | base64)
OLD_MANIFEST=$(echo "${!OLD_MANIFEST_VAR}" | tr -d '[:space:]' | base64)
# Compare the new and old manifests to see if they don't equal
if [ "$NEW_MANIFEST" != "$OLD_MANIFEST" ]; then
UPDATED_IMAGES+="$IMAGE "
fi
done
echo "UPDATED_IMAGES=$UPDATED_IMAGES" >> $GITHUB_ENV
- name: Notify on updated images
if: env.UPDATED_IMAGES != ''
run: |
for IMAGE in $UPDATED_IMAGES; do
case $IMAGE in
"dota") UUID="esgckgc" ;;
"twitch_events") UUID="aopskdk" ;;
"twitch_chat") UUID="gahgag" ;;
"steam") UUID="asldja" ;;
esac
curl -s -X GET -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" "https://${{ secrets.COOLIFY_HOST }}/api/v1/deploy?uuid=${UUID}&force=false"
done

0 comments on commit 08c0bec

Please sign in to comment.