mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-07-22 03:00:29 +00:00
add: cron and commit after sync in deploy workflow
This commit is contained in:
parent
a2d1cf4470
commit
06c4b51228
2 changed files with 17 additions and 1 deletions
17
.github/workflows/deploy.yml
vendored
17
.github/workflows/deploy.yml
vendored
|
|
@ -6,10 +6,13 @@ on:
|
|||
branches: [main]
|
||||
# Ручной запуск
|
||||
workflow_dispatch:
|
||||
# Автоматическая синхронизация каждые 6 часов
|
||||
schedule:
|
||||
- cron: "0 */6 * * *"
|
||||
|
||||
# Разрешения для GitHub Pages
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
|
|
@ -42,6 +45,18 @@ jobs:
|
|||
OBSIDIAN_VAULT_TOKEN: ${{ secrets.OBSIDIAN_VAULT_TOKEN }}
|
||||
run: bash scripts/sync-obsidian-notes.sh
|
||||
|
||||
- name: Commit synced notes
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add content/obsidian-notes/
|
||||
if ! git diff --cached --quiet; then
|
||||
git commit -m "sync: update obsidian notes [skip ci]"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
|
||||
- name: Install Quartz plugins
|
||||
run: npx tsx ./quartz/plugins/loader/install-plugins.ts
|
||||
env:
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -12,3 +12,4 @@ private/
|
|||
replit.nix
|
||||
.quartz/
|
||||
quartz/cli/tui/dist/
|
||||
.env
|
||||
Loading…
Reference in a new issue