Repository navigation
71 lines (58 loc) · 1.95 KB
/
Copy pathworkflow.yml
File metadata and controls
71 lines (58 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Publish Obsidian Vault with Quartz
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout vault
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Clone Quartz
run: git clone -b v4 https://github.com/jackyzha0/quartz.git quartz
- name: Inject vault into Quartz content
run: |
# Clean default content
rm -rf quartz/content/*
# Sync all vault content
rsync -av \
--exclude quartz \
--exclude .git \
--exclude .github \
--exclude .obsidian \
--exclude quartz.config.ts \
--exclude quartz.layout.ts \
--exclude custom.scss \
--exclude docker-compose.quartz.yml \
--exclude docker-compose.yml \
--exclude compose.yml \
./ quartz/content/
# Copy custom config/layout to quartz root if they exist
[ -f quartz.config.ts ] && cp quartz.config.ts quartz/
[ -f quartz.layout.ts ] && cp quartz.layout.ts quartz/
[ -f custom.scss ] && cp custom.scss quartz/quartz/styles/custom.scss
# Override default Quartz favicon with hackctl.com logo
[ -f static/icon.png ] && cp static/icon.png quartz/quartz/static/icon.png
- name: Install Quartz dependencies
working-directory: quartz
run: npm ci
- name: Build site
working-directory: quartz
run: npx quartz build
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: quartz/public
publish_branch: gh-pages
force_orphan: true
cname: docs.hackctl.com