Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:

env:
DOCKER_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/Wizard-Agent
COOLIFY_URL: ${{ secrets.COOLIFY_URL }}
COOLIFY_RESOURCE_ID: ${{ secrets.COOLIFY_RESOURCE_ID }}
COOLIFY_API_TOKEN: ${{ secrets.COOLIFY_API_TOKEN }}

jobs:
build-and-push:
Expand Down Expand Up @@ -101,3 +104,28 @@ jobs:
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

- name: Validate Coolify variables
env:
COOLIFY_URL: ${{env.COOLIFY_URL}}
run: |
echo "Validating that coolify_url doesn't end in '/'"
echo "$COOLIFY_URL" | grep -P '[^/]$'

- name: Update source commit SHA in Coolify
uses: fjogeleit/http-request-action@v1
with:
url: ${{env.COOLIFY_URL}}/api/v1/applications/${{env.COOLIFY_RESOURCE_ID}}
method: PATCH
bearerToken: ${{env.COOLIFY_API_TOKEN}}
data: >-
{
"git_commit_sha": "${{github.sha}}"
}

- name: Trigger Coolify deployment via webhook
uses: fjogeleit/http-request-action@v1
with:
url: ${{env.COOLIFY_URL}}/api/v1/deploy?uuid=${{env.COOLIFY_RESOURCE_ID}}&force=false
method: GET
bearerToken: ${{env.COOLIFY_API_TOKEN}}