-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
57 lines (48 loc) · 1.28 KB
/
Taskfile.yml
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
# https://taskfile.dev
version: '3'
tasks:
build:data:
silent: true
cmds:
- if ! [ -d ./dist ]; then mkdir dist; fi
- |
cd tools/staticBuilder
npm run build:posts
npm run build:rss
build:frontend:
silent: true
dir: frontend
cmds:
- npm run build
run:frontend:
silent: true
dir: frontend
cmds:
- npm run dev -- --host
deploy:data:staging:
silent: true
cmds:
- rclone copyto dist/posts.json r2:flinnlab-blog-dev/posts.json
- rclone copyto dist/rss.xml r2:flinnlab-blog-dev/rss.xml
- rclone sync data/images/ r2:flinnlab-blog-images-dev
deploy:data:production:
silent: true
dir: data
cmds:
#- rclone copyto posts.json r2:flinnlab-blog-dev/posts.json
- rclone sync images/ r2:flinnlab-blog-images
install:hooks:
silent: true
cmds:
- rm -rf .git/hooks
- ln -s $PWD/tools/git-hooks .git/hooks
new:post:
silent: true
dir: ./data/posts
cmds:
- |
latest_post=$(ls ./[0-9][0-9][0-9][0-9]* | sort | tail -n 1)
latest_post_file=$(basename $latest_post)
latest_post_id=$(echo "${latest_post_file:0:4}")
next_id=$( printf "%04d" $((latest_post_id + 1)) )
cp wip-template.md $next_id-slug.md