From 3522f243b8e86c2c9341b3f4e41ac6cfcd622a7a Mon Sep 17 00:00:00 2001 From: dimkk Date: Sat, 3 Jan 2026 19:27:49 +0300 Subject: [PATCH] chpore: add gitea stuff --- .gitea/workflows/ai-solve-issue.yml | 20 +++++++++++++ .gitea/workflows/deploy.yml | 44 +++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .gitea/workflows/ai-solve-issue.yml create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/ai-solve-issue.yml b/.gitea/workflows/ai-solve-issue.yml new file mode 100644 index 0000000..78360b9 --- /dev/null +++ b/.gitea/workflows/ai-solve-issue.yml @@ -0,0 +1,20 @@ +# .gitea/workflows/ai-solve-issue.yml +name: AI Issue Solver + +on: + issues: + types: [labeled] + +jobs: + solve: + if: github.event.label.name == 'ai-solve' + runs-on: opencode + steps: + - name: Solve Issue + env: + GITEA_URL: ${{ secrets.GITEA_URL }} + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + REPO_OWNER: ${{ github.repository_owner }} + REPO_NAME: ${{ github.event.repository.name }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + run: solve-issue \ No newline at end of file diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..1586c3d --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,44 @@ +# .gitea/workflows/deploy.yml +name: CI/CD + +on: + push: + branches: [main, staging] + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + - run: bun ci + - run: bun test + + # Preview - handled automatically by Coolify! + # No action needed here + + deploy-staging: + needs: test + if: github.ref == 'refs/heads/staging' + runs-on: ubuntu-latest + steps: + - name: Trigger Coolify Staging Deploy + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \ + "${{ secrets.COOLIFY_URL }}/api/v1/applications/${{ secrets.COOLIFY_STAGING_APP_ID }}/deploy" + + deploy-prod: + needs: test + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Trigger Coolify Production Deploy + run: | + curl -X POST \ + -H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \ + "${{ secrets.COOLIFY_URL }}/api/v1/applications/${{ secrets.COOLIFY_PROD_APP_ID }}/deploy" \ No newline at end of file