Files
Duc Nguyen 29667cd92f ref: up
2026-03-18 20:21:56 +07:00

73 lines
2.1 KiB
YAML

name: "Development Deployment"
on:
push:
branches: [ main, develop ]
workflow_dispatch:
jobs:
deploy:
name: Deploy to development
runs-on: ubuntu-latest
environment: development
steps:
- name: ☸️ Checkout
uses: actions/checkout@v4
- name: 🐍 Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: 📦 Install dependencies
run: |
pip install -r dev-requirements.txt
- name: 🔍 Lint with flake8
run: flake8 src/ --max-line-length=88 --extend-ignore=E203,W503
- name: 🎨 Check formatting with black
run: black --check src/
- name: 🧪 Run tests
run: pytest --cov=src --cov-report=xml
- name: 📤 Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: false
- name: ☸️ Setup kubectl
uses: azure/setup-kubectl@v4
with:
version: 'v1.28.0'
- name: 🔐 Configure Kubeconfig
uses: azure/k8s-set-context@v4
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBECONFIG_DEV }}
- name: 🚀 Install Fission CLI
run: |
curl -L https://github.com/fission/fission/releases/latest/download/fission-linux-amd64 -o /tmp/fission
sudo install /tmp/fission /usr/local/bin/fission
fission check
- name: 📦 Build and Deploy (dev)
run: |
echo "Deploying to development environment..."
fission deploy --dev
- name: 🔔 Notify success
if: always()
uses: actions/github-script@v7
with:
script: |
const status = '${{ job.status }}';
const emoji = status === 'success' ? '🟢' : '🔴';
const message = `${emoji} Dev deployment ${status} for ${{ github.repository }}@${{ github.sha }}\nCommit: ${{ github.event.commits[0].message }}`;
// Send to Slack/Telegram/etc - customize as needed
console.log(message);