ref: up
This commit is contained in:
72
fission-python/template/.gitea/workflows/dev-deployment.yaml
Normal file
72
fission-python/template/.gitea/workflows/dev-deployment.yaml
Normal file
@@ -0,0 +1,72 @@
|
||||
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);
|
||||
Reference in New Issue
Block a user