Skip to content

Commit efc7ba0

Browse files
committed
ci: simplify sync workflow, remove Node/build step and Web-deploy branch
1 parent d2b82c2 commit efc7ba0

1 file changed

Lines changed: 6 additions & 50 deletions

File tree

.github/workflows/sync-logseq-content.yml

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -49,47 +49,16 @@ jobs:
4949
echo "files_before=$before" >> $GITHUB_OUTPUT
5050
echo "files_after=$after" >> $GITHUB_OUTPUT
5151
52-
- name: Setup Node.js
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: 22
56-
57-
- name: Cache Node Modules
58-
uses: actions/cache@v4
59-
with:
60-
path: quartz-site/node_modules
61-
key: ${{ runner.os }}-node-modules-${{ hashFiles('quartz-site/package-lock.json') }}
62-
restore-keys: |
63-
${{ runner.os }}-node-modules-
64-
65-
- name: Install Dependencies
66-
run: |
67-
cd quartz-site
68-
npm install
69-
70-
- name: Cache Quartz Build Cache
71-
uses: actions/cache@v4
72-
with:
73-
path: quartz-site/.quartz-cache
74-
key: ${{ runner.os }}-quartz-cache-${{ github.run_id }}
75-
restore-keys: |
76-
${{ runner.os }}-quartz-cache-
77-
78-
- name: Build Quartz static site
79-
run: |
80-
cd quartz-site
81-
npx quartz build
82-
83-
- name: Check for changes in the generated static output
52+
- name: Check for changes in content/
8453
id: changes
8554
run: |
8655
cd quartz-site
8756
git add content/
88-
if git diff --staged --quiet && [ -z "$(git status --porcelain public/)" ]; then
57+
if git diff --staged --quiet; then
8958
echo "has_changes=false" >> $GITHUB_OUTPUT
9059
echo "No changes detected — skipping deploy."
9160
else
92-
changed=$(git status --porcelain public/ | wc -l)
61+
changed=$(git status --porcelain content/ | wc -l)
9362
echo "has_changes=true" >> $GITHUB_OUTPUT
9463
echo "changed_count=$changed" >> $GITHUB_OUTPUT
9564
fi
@@ -106,27 +75,14 @@ jobs:
10675
git commit -m "sync: content updated from Logseq (Admin@$COMMIT_SHA)"
10776
git push origin Web-live
10877
109-
- name: Deploy Pre-built site to Web-deploy branch
110-
if: steps.changes.outputs.has_changes == 'true'
111-
run: |
112-
cd quartz-site/public
113-
git init
114-
git config user.name "github-actions[bot]"
115-
git config user.email "github-actions[bot]@users.noreply.github.com"
116-
git checkout -b Web-deploy
117-
git add .
118-
git commit -m "deploy: pre-built from GitHub Actions"
119-
git remote add origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git"
120-
git push -f origin Web-deploy
121-
12278
- name: Summary
12379
run: |
12480
if [ "${{ steps.changes.outputs.has_changes }}" == "true" ]; then
125-
echo "### ✅ Build & Sync complete" >> $GITHUB_STEP_SUMMARY
81+
echo "### ✅ Sync complete" >> $GITHUB_STEP_SUMMARY
12682
echo "- **Files before:** ${{ steps.sync.outputs.files_before }}" >> $GITHUB_STEP_SUMMARY
12783
echo "- **Files after:** ${{ steps.sync.outputs.files_after }}" >> $GITHUB_STEP_SUMMARY
128-
echo "- Vercel will deploy instantly from **Web-deploy** branch." >> $GITHUB_STEP_SUMMARY
84+
echo "- Changes pushed to **Web-live**. Vercel will build and deploy automatically." >> $GITHUB_STEP_SUMMARY
12985
else
13086
echo "### ⏭️ No changes" >> $GITHUB_STEP_SUMMARY
131-
echo "Content was already up to date — no commit or deploy made." >> $GITHUB_STEP_SUMMARY
87+
echo "Content was already up to date — no commit made." >> $GITHUB_STEP_SUMMARY
13288
fi

0 commit comments

Comments
 (0)