Files
Space-Banane 4f0ef035cc
All checks were successful
ci / test (push) Successful in 9s
ci / deploy-coolify (push) Successful in 7s
ci / push-image (push) Successful in 35s
fix: update image tags in CI workflow for proper repository naming
2026-05-29 19:42:06 +02:00

76 lines
2.0 KiB
YAML

name: ci
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: install deps
run: pip install -e ".[dev]"
- name: run tests
run: pytest -q
push-image:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup buildx
uses: docker/setup-buildx-action@v3
- name: log in to harbor
uses: docker/login-action@v3
with:
registry: registry.reversed.dev
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}
- name: build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
provenance: false
sbom: false
tags: |
registry.reversed.dev/git-activity-merger/${{ github.event.repository.name }}:latest
registry.reversed.dev/git-activity-merger/${{ github.event.repository.name }}:${{ github.sha }}
deploy-coolify:
needs: push-image
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: wait before redeploy
run: sleep 5
- name: Redeploy Coolify
run: |
response_file="$(mktemp)"
http_code="$(curl -sS -o "$response_file" -w "%{http_code}" -X GET "${{ secrets.COOLIFY_WEBHOOK }}" \
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}")"
echo "Coolify webhook HTTP status: $http_code"
echo "Coolify webhook response body:"
cat "$response_file"
if [ "$http_code" -lt 200 ] || [ "$http_code" -ge 300 ]; then
echo "Redeploy request failed with non-2xx status."
exit 1
fi