sqlite-web 0.7.2
gitea.db
action_run_job
Create
Query
access
access_token
action
action_artifact
action_run
action_run_index
action_run_job
action_runner
action_runner_token
action_schedule
action_schedule_spec
action_task
action_task_output
action_task_step
action_tasks_version
action_variable
app_state
attachment
auth_token
badge
branch
collaboration
comment
commit_status
commit_status_index
commit_status_summary
commit_sync_log
commit_sync_status
dbfs_data
dbfs_meta
deploy_key
email_address
email_hash
external_login_user
follow
gpg_key
gpg_key_import
hook_task
issue
issue_assignees
issue_content_history
issue_dependency
issue_index
issue_label
issue_pin
issue_user
issue_watch
label
language_stat
lfs_lock
lfs_meta_object
login_source
milestone
mirror
notice
notification
oauth2_application
oauth2_authorization_code
oauth2_grant
org_user
package
package_blob
package_blob_upload
package_cleanup_rule
package_file
package_property
package_version
project
project_board
project_issue
protected_branch
protected_tag
public_key
pull_auto_merge
pull_request
push_mirror
reaction
release
renamed_branch
repo_archiver
repo_hidden_file
repo_indexer_status
repo_license
repo_redirect
repo_topic
repo_transfer
repo_unit
repository
review
review_state
secret
session
sqlite_sequence
star
stopwatch
system_setting
task
team
team_invite
team_repo
team_unit
team_user
topic
tracked_time
two_factor
upload
user
user_badge
user_blocking
user_open_id
user_redirect
user_setting
version
watch
webauthn_credential
webhook
Toggle helper tables
Structure
Content
Query
Insert
Drop
Import
Export
Delete row 7839 from action_run_job
id
7839
run_id
6703
repo_id
6
owner_id
5
commit_sha
e112d45af414e4862c0328abad7c4df74d3c1dbf
is_fork_pull_request
0
name
部署到 Staging
attempt
0
workflow_payload
name: Deploy "on": push: branc
name: Deploy "on": push: branches: [main] tags: ['v*'] workflow_dispatch: inputs: environment: description: '部署环境' required: true default: 'staging' type: choice options: - staging - production - rollback skip_tests: description: '跳过测试(紧急修复时使用)' required: false default: false type: boolean env: IMAGE_PREFIX: ${{ github.repository_owner }}/juhi NODE_VERSION: "20" PNPM_VERSION: "8" REGISTRY: ghcr.io jobs: deploy-staging: name: 部署到 Staging runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' || github.event.inputs.environment == 'staging' steps: - name: 检出代码 uses: actions/checkout@v4 - name: 配置 SSH uses: webfactory/ssh-agent@v0.8.0 with: ssh-private-key: ${{ secrets.STAGING_SSH_KEY }} - name: 配置 SSH Known Hosts run: | mkdir -p ~/.ssh echo "${{ secrets.STAGING_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts chmod 644 ~/.ssh/known_hosts - name: 同步部署文件 run: | # 同步 docker-compose 和脚本到服务器 rsync -avz --delete \ docker-compose.prod.yml \ scripts/ \ deploy/ \ $USER@$HOST:$DEPLOY_PATH/ env: HOST: ${{ secrets.STAGING_HOST }} USER: ${{ secrets.STAGING_USER }} DEPLOY_PATH: /opt/juhi - name: 部署到 Staging 服务器 run: | ssh $USER@$HOST << EOF cd $DEPLOY_PATH # 更新镜像标签 export API_IMAGE="${API_IMAGE}" export FRONTEND_IMAGE="${FRONTEND_IMAGE}" # 拉取最新镜像 docker compose -f docker-compose.prod.yml pull api frontend # 执行数据库迁移(Prisma) echo "==> 执行数据库迁移..." docker compose -f docker-compose.prod.yml --profile migrate run --rm migrate if [ \$? -ne 0 ]; then echo "数据库迁移失败,终止部署" exit 1 fi # 滚动更新 docker compose -f docker-compose.prod.yml up -d --no-deps api echo "==> 等待 API 服务就绪..." # 健康检查(带重试) RETRY=0 MAX_RETRY=12 until curl -sf http://localhost:3000/health > /dev/null 2>&1; do RETRY=\$((RETRY + 1)) if [ \$RETRY -ge \$MAX_RETRY ]; then echo "API 健康检查超时(60s),部署失败" docker compose -f docker-compose.prod.yml logs --tail=50 api exit 1 fi echo " 等待 API 就绪... (\${RETRY}/\${MAX_RETRY})" sleep 5 done echo "==> API 健康检查通过" # 更新前端 docker compose -f docker-compose.prod.yml up -d --no-deps frontend # 重载 Nginx(应用新配置) docker compose -f docker-compose.prod.yml exec -T nginx nginx -s reload 2>/dev/null || true # 清理旧镜像 docker image prune -f EOF env: HOST: ${{ secrets.STAGING_HOST }} USER: ${{ secrets.STAGING_USER }} DEPLOY_PATH: /opt/juhi API_IMAGE: ${{ needs.build-and-push.outputs.api-image }} FRONTEND_IMAGE: ${{ needs.build-and-push.outputs.frontend-image }} - name: Staging 部署验证 run: | ssh $USER@$HOST << 'EOF' cd /opt/juhi # 运行快速验证(如果脚本存在) if [ -f "./scripts/post-deploy-verify.sh" ]; then chmod +x ./scripts/post-deploy-verify.sh ./scripts/post-deploy-verify.sh --quick || echo "⚠️ 部署验证有警告,请检查日志" else # 基础健康检查 curl -sf http://localhost:3000/health || exit 1 echo "基础健康检查通过" fi EOF env: HOST: ${{ secrets.STAGING_HOST }} USER: ${{ secrets.STAGING_USER }} - if: always() name: Slack 通知 uses: 8398a7/action-slack@v3 with: status: ${{ job.status }} text: Staging 部署 ${{ job.status }} - ${{ needs.build-and-push.outputs.version }} webhook_url: ${{ secrets.SLACK_WEBHOOK }} timeout-minutes: "15"
...
job_id
deploy-staging
needs
["build-and-push"]
runs_on
["ubuntu-latest"]
task_id
0
status
3
started
0
stopped
1773832744
created
1773831749
updated
1773832744
raw_concurrency
is_concurrency_evaluated
0
concurrency_group
concurrency_cancel
0
Delete
Cancel