diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9e335e8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: Kubernetes YAML Validation + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + validate-yaml: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install kubeval + run: | + wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz + tar xf kubeval-linux-amd64.tar.gz + sudo mv kubeval /usr/local/bin + + - name: Validate Kubernetes YAML files + run: | + find . -name '*.yaml' -o -name '*.yml' | while read file; do + echo "Validating $file" + kubeval "$file" || true + done + + yaml-lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: YAML Lint + uses: ibiqlik/action-yamllint@v3 + with: + file_or_dir: . + config_file: .yamllint + strict: false + + security-scan: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: 'config' + scan-ref: '.' + format: 'table' + exit-code: '0' + severity: 'CRITICAL,HIGH' diff --git a/.github/workflows/sync-upstream.yml b/.github/workflows/sync-upstream.yml new file mode 100644 index 0000000..9f0bc74 --- /dev/null +++ b/.github/workflows/sync-upstream.yml @@ -0,0 +1,48 @@ +name: Sync Fork with Upstream + +on: + schedule: + - cron: '0 */6 * * *' # Every 6 hours + workflow_dispatch: # Manual trigger + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Add upstream remote + run: | + git remote add upstream https://github.com/Zhoneym/DifyAI-Kubernetes.git || true + git fetch upstream + + - name: Merge upstream changes + run: | + git checkout main + git merge upstream/main --no-edit || echo "No changes to merge" + + - name: Push changes + run: git push origin main + continue-on-error: true + + - name: Create Pull Request if conflicts + if: failure() + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Sync fork with upstream + title: '🔄 Sync with upstream repository' + body: | + This PR syncs the fork with the upstream repository. + Please review and resolve any conflicts. + branch: sync-upstream + delete-branch: true diff --git a/helm-chart/difyai/Chart.yaml b/helm-chart/difyai/Chart.yaml new file mode 100644 index 0000000..a811d32 --- /dev/null +++ b/helm-chart/difyai/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v2 +name: difyai +description: Helm chart for DifyAI platform on Kubernetes +type: application +version: 0.1.0 +appVersion: "1.7.0" + +maintainers: + - name: FreeAiHub + url: https://github.com/FreeAiHub + +keywords: + - dify + - ai + - kubernetes + - llm + - chatbot