Add Gitea Actions CI/CD: build image + trigger Coolify deploy
Some checks failed
Build & Deploy / build-and-deploy (push) Failing after 46s
Some checks failed
Build & Deploy / build-and-deploy (push) Failing after 46s
On push to main, the workflow builds a Docker image, pushes to Gitea Container Registry, then triggers Coolify to pull and redeploy. Replaces the old Dockerfile-build-on-deploy approach. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
40
.gitea/workflows/deploy.yaml
Normal file
40
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
name: Build & Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: gitea.nautilus.marcusgroup.org
|
||||||
|
IMAGE: ezer-mishpati/legal-ai
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | \
|
||||||
|
docker login ${{ env.REGISTRY }} \
|
||||||
|
-u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
||||||
|
|
||||||
|
- name: Build and push image
|
||||||
|
run: |
|
||||||
|
TAG="${{ env.REGISTRY }}/${{ env.IMAGE }}:latest"
|
||||||
|
SHA_TAG="${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}"
|
||||||
|
docker build -t "$TAG" -t "$SHA_TAG" .
|
||||||
|
docker push "$TAG"
|
||||||
|
docker push "$SHA_TAG"
|
||||||
|
|
||||||
|
- name: Trigger Coolify redeploy
|
||||||
|
run: |
|
||||||
|
# 172.17.0.1 = Docker bridge gateway → host
|
||||||
|
curl -sf \
|
||||||
|
"http://172.17.0.1:8000/api/v1/deploy?uuid=my85gabx37ele9aouub8t8ju&force=true" \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}"
|
||||||
Reference in New Issue
Block a user