Initial commit: SIBU 2.0 MISSION
This commit is contained in:
57
.gitea/workflows/deploy.yaml
Normal file
57
.gitea/workflows/deploy.yaml
Normal file
@ -0,0 +1,57 @@
|
||||
name: Deploy to Coolify
|
||||
run-name: ${{ gitea.actor }} is executing Deploy to Coolify 🚀
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
quality-assurance:
|
||||
name: Quality Assurance
|
||||
uses: ./.gitea/workflows/quality_assurance.yaml
|
||||
|
||||
deploy:
|
||||
name: Deploy to Coolify
|
||||
runs-on: ubuntu-latest
|
||||
needs: quality-assurance
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Deploy to Coolify
|
||||
env:
|
||||
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
|
||||
COOLIFY_WEBHOOK_URL: ${{ secrets.COOLIFY_WEBHOOK_URL }}
|
||||
COOLIFY_UI_WEBHOOK_URL: ${{ secrets.COOLIFY_UI_WEBHOOK_URL }}
|
||||
COOLIFY_API_TOKEN: ${{ secrets.COOLIFY_API_TOKEN }}
|
||||
run: |
|
||||
echo "Deploying to Coolify..."
|
||||
if [ -z "$COOLIFY_WEBHOOK_URL" ]; then
|
||||
echo "Error: COOLIFY_WEBHOOK_URL environment variable not set"
|
||||
echo "Please set COOLIFY_WEBHOOK_URL in your environment or .env file"
|
||||
exit 1
|
||||
fi
|
||||
echo "Triggering Coolify deployment via webhook..."
|
||||
curl -X POST "$COOLIFY_WEBHOOK_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $COOLIFY_API_TOKEN" \
|
||||
-d '{"source": "gitea", "branch": "main", "commit": "'$(git rev-parse HEAD)'"}' \
|
||||
--silent --show-error
|
||||
curl -X POST "$COOLIFY_UI_WEBHOOK_URL" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $COOLIFY_API_TOKEN" \
|
||||
-d '{"source": "gitea", "branch": "main", "commit": "'$(git rev-parse HEAD)'"}' \
|
||||
--silent --show-error
|
||||
echo "Coolify deployment triggered successfully! UI deployment triggered successfully!"
|
||||
|
||||
# Step to run if deploy fails
|
||||
- name: Notify on Deploy Failure
|
||||
if: failure()
|
||||
env:
|
||||
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
|
||||
run: |
|
||||
curl --location "https://api.telegram.org/bot$TG_BOT_TOKEN/sendMessage" \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data '{"chat_id": "-1002299691117", "message_thread_id": 7, "text": "[*Vertex CRM*](https://crm.vertexdc.com) Deploy to Coolify has FAILED", "parse_mode": "MarkdownV2"}'
|
||||
42
.gitea/workflows/quality_assurance.yaml
Normal file
42
.gitea/workflows/quality_assurance.yaml
Normal file
@ -0,0 +1,42 @@
|
||||
name: Quality Assurance
|
||||
run-name: ${{ gitea.actor }} is executing Quality Assurance 🚀
|
||||
on:
|
||||
# Disabled push events, because it hinders the deployment process
|
||||
# push:
|
||||
# branches-ignore:
|
||||
# - main # Allow push events on all branches except main
|
||||
pull_request: {}
|
||||
workflow_call: # This allows other workflows to call this workflow
|
||||
|
||||
jobs:
|
||||
Quality-Assurance:
|
||||
name: Quality Assurance
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y libpq-dev postgresql
|
||||
- name: Set up Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
- name: Set up Python 3.12
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
- name: Install uv
|
||||
run: |
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
- name: Install Python Dependencies
|
||||
run: |
|
||||
make install
|
||||
- name: Lint with black
|
||||
run: |
|
||||
make lint-backend
|
||||
- run: echo "🍏 This job's status is ${{ job.status }}."
|
||||
Reference in New Issue
Block a user