Commit 7b70b25
committed
Simplify workflow for deploying new HTML pages
Cloning the entire repo is very slow, due to the gh-pages branch
containing nearly 2GiB of static html files. The current version of the
deploy.yml workflow uses actions/cache@v4 to cache a copy of the full
repo which can be retrieved much faster than doing a clone. This makes
the workflow faster, but is complex to understand. It also doesn't help
if no changes have been pushed to the master branch for more than a
week, because the cache expires and so a full clone is needed anyway.
This change attempts to remove the cache so that the workflow is simpler
to understand and more robust.
To avoid cloning the full repo, the initial clone uses the magic number
fetch-depth:2147483647 i.e. INT_MAX. According to the documentation at
https://git-scm.com/docs/shallow this means infinite depth. However,
unlike fetch-depth:0 it implies the --single-branch option for the
clone, so only the master branch is fetched and not the huge gh-pages
branch.
The gh-pages branch is still needed in order to push to that branch, but
we clone that in a separate step (into a sub-directory) using
fetch-depth:1 to avoid fetching the full history. That step doesn't need
to change, as it wasn't using the cache anyway.1 parent 71d5154 commit 7b70b25
1 file changed
+6
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 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 | | - | |
| 15 | + | |
46 | 16 | | |
47 | 17 | | |
48 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
49 | 22 | | |
50 | 23 | | |
51 | 24 | | |
| |||
56 | 29 | | |
57 | 30 | | |
58 | 31 | | |
59 | | - | |
60 | | - | |
| 32 | + | |
61 | 33 | | |
62 | 34 | | |
63 | 35 | | |
| |||
0 commit comments