"vscode:/vscode.git/clone" did not exist on "ec202742606d749aa3f1a54dda9e2c492b51e9e2"
deploy.py 447 Bytes
Newer Older
1
# Deploy the documents
Lianmin Zheng's avatar
Lianmin Zheng committed
2
3
4
5
6

import os
from datetime import datetime


7
8
9
def run_cmd(cmd):
    print(cmd)
    os.system(cmd)
Lianmin Zheng's avatar
Lianmin Zheng committed
10
11


12
run_cmd("cd $DOC_SITE_PATH; git pull")
Lianmin Zheng's avatar
Lianmin Zheng committed
13

14
15
# (Optional) Remove old files
# run_cmd("rm -rf $ALPA_SITE_PATH/*")
Lianmin Zheng's avatar
Lianmin Zheng committed
16

17
run_cmd("cp -r _build/html/* $DOC_SITE_PATH")
Lianmin Zheng's avatar
Lianmin Zheng committed
18

19
20
21
22
cmd_message = f"Update {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
run_cmd(
    f"cd $DOC_SITE_PATH; git add .; git commit -m '{cmd_message}'; git push origin main"
)