guanghulab/.github/archived-workflows/sync-griddb-to-drive.yml
Guanghu Domestic Migration d1e47f4565
Some checks are pending
自动更新代码和重启 / update-and-restart (push) Waiting to run
CI检查 + 自动部署 / check (push) Waiting to run
CI检查 + 自动部署 / deploy (push) Blocked by required conditions
重启聊天服务 / restart (push) Waiting to run
chore: import sanitized domestic snapshot for REPO-002
Source snapshot: ca48d3ddf926d79aa138306164169baf764bb829
2026-07-17 15:54:41 +08:00

44 lines
1.3 KiB
YAML

name: 🪞 Grid-DB → Google Drive 镜像同步
on:
push:
paths:
- 'grid-db/memory/**'
- 'grid-db/outbox/latest/**'
- 'grid-db/rules/**'
- 'grid-db/drive-index/**'
schedule:
- cron: '*/15 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
sync-to-drive:
if: github.actor != 'zhuyuan-bot' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 🔧 安装依赖
run: npm install googleapis
- name: 🪞 同步到 Google Drive
env:
GDRIVE_CLIENT_ID: ${{ secrets.GDRIVE_CLIENT_ID }}
GDRIVE_CLIENT_SECRET: ${{ secrets.GDRIVE_CLIENT_SECRET }}
GDRIVE_REFRESH_TOKEN: ${{ secrets.GDRIVE_REFRESH_TOKEN }}
DRIVE_FOLDER_ID: ${{ secrets.DRIVE_MIRROR_FOLDER_ID }}
run: node scripts/grid-db/sync-to-drive.js
- name: 📋 写同步日志
run: |
mkdir -p grid-db/logs
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) | sync-to-drive | OK" >> grid-db/logs/drive-sync.log
git config user.name "zhuyuan-bot"
git config user.email "zhuyuan@guanghulab.com"
git add -f grid-db/logs/drive-sync.log
git diff --cached --quiet || git commit -m "log: Drive sync [skip ci]"
git push