File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -54,3 +54,36 @@ deploy:
54
54
` ` `
55
55
56
56
That's it!
57
+
58
+ # ## Deploying to GitHub Pages manually
59
+
60
+ If your CI doesn't support GitHub pages, or you're deploying somewhere else
61
+ with integrations such as Github Pages :
62
+ *note: you may want to use different tmp dirs*:
63
+
64
+ ` ` ` console
65
+ $> git worktree add /tmp/book gh-pages
66
+ $> mdbook build
67
+ $> rm -rf /tmp/book/* # this won't delete the .git directory
68
+ $> cp -rp book/* /tmp/book/
69
+ $> cd /tmp/book
70
+ $> git add -A
71
+ $> git commit 'new book message'
72
+ $> git push origin gh-pages
73
+ $> cd -
74
+ ` ` `
75
+
76
+ Or put this into a Makefile rule :
77
+
78
+ ` ` ` makefile
79
+ .PHONY: deploy
80
+ deploy: book
81
+ @echo "====> deploying to github"
82
+ git worktree add /tmp/book gh-pages
83
+ rm -rf /tmp/book/*
84
+ cp -rp book/* /tmp/book/
85
+ cd /tmp/book && \
86
+ git add -A && \
87
+ git commit -m "deployed on $(shell date) by ${USER}" && \
88
+ git push origin gh-pages
89
+ ` ` `
You can’t perform that action at this time.
0 commit comments