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
---
version: 3

# env:

vars:
  BENCHTIME: 4s

tasks:
  default:
    deps: [all]

  cleanbuild:
    deps: [clean, full]

  quarto:
    desc: "compile quarto files"
    dir: "content"
    cmds:
      - quarto render *.qmd --output-dir ./output --to html

  noteindex:
    desc: "generate note dir index"
    cmds:
      - "python bin/genindex.py ./content/note/ ./content/note/"

  pipremote:
    desc: "Update Pip environment on remote server"
    cmds:
      - ssh [email protected] 'cd ~/btbytes/; ./venv/bin/pip install -r requirements.txt'

  all:
    desc: "Only build the changes"
    cmds:
      - python sitebuild
  full:
    desc: "Do a full build"
    cmds:
      - python sitebuild --full

  remote:
    desc: "Sync changes to remote"
    cmds:
      - "/usr/bin/rsync -avz -d --delete-after -e ssh ./output/ [email protected]:/data/web/www.btbytes.com/www/"
  clean:
    desc: "Delete the old build"
    cmds:
      - rm -rf output
  push:
    desc: "push the site after committing all (usage: task push -- 'Your commit message')"
    cmds:
      - git add .
      - |
        if [ -n "{{.CLI_ARGS}}" ]; then
          git commit -am "{{.CLI_ARGS}}"
        else
          git commit -am "adding more changes"
        fi
      - git push origin master