mirror of
https://github.com/langgenius/dify.git
synced 2026-08-24 12:32:54 -04:00
fde800e337
# Conflicts: # .github/dependabot.yml # .github/workflows/deploy-dev.yml # api/app_factory.py # api/core/indexing_runner.py # api/services/feature_service.py # api/tests/test_containers_integration_tests/controllers/console/auth/test_password_reset.py # api/tests/test_containers_integration_tests/services/test_feature_service.py # api/tests/unit_tests/controllers/console/auth/test_account_activation.py # api/tests/unit_tests/controllers/service_api/app/test_conversation.py # api/tests/unit_tests/controllers/web/test_site.py # api/tests/unit_tests/core/rag/indexing/test_indexing_runner.py # api/tests/unit_tests/core/tools/test_base_tool.py # api/tests/unit_tests/extensions/otel/test_retrieval_tracing.py # api/tests/unit_tests/extensions/test_ext_login.py # api/tests/unit_tests/services/test_feature_service_deployment_edition.py # api/tests/unit_tests/services/test_feature_service_knowledge_fs.py # api/tests/unit_tests/services/test_feature_service_licensed_seats.py
73 lines
2.5 KiB
YAML
73 lines
2.5 KiB
YAML
name: Deploy Dev
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ['KnowledgeFS CI']
|
|
branches:
|
|
- 'deploy/konwledge'
|
|
types:
|
|
- completed
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: depot-ubuntu-24.04
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
if: |
|
|
github.event.workflow_run.conclusion == 'success' &&
|
|
github.event.workflow_run.head_branch == 'deploy/konwledge'
|
|
steps:
|
|
- name: Wait for API and Web image build
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
timeout-minutes: 35
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const workflowId = "build-push.yml";
|
|
const headBranch = context.payload.workflow_run.head_branch;
|
|
const headSha = context.payload.workflow_run.head_sha;
|
|
const deadline = Date.now() + 30 * 60 * 1000;
|
|
const pollIntervalMs = 15 * 1000;
|
|
|
|
while (Date.now() < deadline) {
|
|
const { data } = await github.rest.actions.listWorkflowRuns({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
workflow_id: workflowId,
|
|
branch: headBranch,
|
|
event: "push",
|
|
head_sha: headSha,
|
|
per_page: 10,
|
|
});
|
|
const run = data.workflow_runs[0];
|
|
|
|
if (!run) {
|
|
core.info(`Waiting for ${workflowId} to start for ${headSha}.`);
|
|
} else if (run.status !== "completed") {
|
|
core.info(`Waiting for ${run.html_url}; current status is ${run.status}.`);
|
|
} else if (run.conclusion !== "success") {
|
|
throw new Error(
|
|
`${workflowId} did not succeed for ${headSha}: ${run.conclusion} (${run.html_url})`,
|
|
);
|
|
} else {
|
|
core.info(`Both image workflows succeeded for ${headSha}: ${run.html_url}`);
|
|
return;
|
|
}
|
|
|
|
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
}
|
|
|
|
throw new Error(`Timed out waiting for ${workflowId} to succeed for ${headSha}.`);
|
|
|
|
- name: Deploy to server
|
|
uses: appleboy/ssh-action@0ff4204d59e8e51228ff73bce53f80d53301dee2 # v1.2.5
|
|
with:
|
|
host: ${{ secrets.SSH_NEW_RAG_HOST }}
|
|
username: ${{ secrets.SSH_USER }}
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
script: |
|
|
${{ vars.SSH_SCRIPT || secrets.SSH_SCRIPT }}
|