Commit Graph
130 Commits
Author SHA1 Message Date
Lawrence Angrave 73a0f1e976 site_deploy: bump the _coursebook pointer instead of only nudging
The website consumes the wiki through the _coursebook submodule and
updates it with --remote, so the SHA recorded in the site's tree never
affects what deploys. It had drifted months behind as a result, which is
a trap for anyone who runs a plain 'git submodule update' and then builds
a stale book.

The trigger commit this script already pushes is the natural place to fix
that: point the gitlink at the wiki commit push_to_wiki.sh just published,
so the recorded pointer matches reality at no extra cost. ls-remote plus
update-index writes the gitlink directly, so the shallow clone never has
to fetch the submodule.

Both steps are non-fatal. The push is what rebuilds the site, and under
'set -e' a transient ls-remote failure would otherwise skip it. The commit
keeps --allow-empty so an already-current pointer still triggers a build.
2026-08-26 14:00:32 -05:00
Lawrence Angrave 8bf29081d3 Speed up CI: install only the texlive packages the book needs
The PDF job takes ~9 minutes and is the whole workflow's wall clock,
because install.sh pulls texlive-full: 455 packages and 4.0 GB of every
language pack, ConTeXt and Metapost. The book needs 68 packages,
768 MB.

Measured by building the book both ways in ubuntu:24.04 and comparing:

                 packages   download   apt install   make pdf
  texlive-full   455        3995 MB    270s          188s
  reduced set     68         768 MB     92s          141s

Output is equivalent, not merely similar: all 19 PDFs (main plus 18
chapters) have identical page counts (main.pdf is 390 pages either
way), identical page sizes, and byte-identical pdftotext output, with
no unresolved references in either.

Also:
- fail-fast: false, so a WIKI failure 90 seconds in stops cancelling
  the 9 minute PDF job. That happened repeatedly while fixing CI: the
  run then says nothing about whether the PDF is healthy.
- concurrency groups, asymmetric on purpose. PR builds have no side
  effects so a superseded run is cancelled. Deploy is NOT cancelled
  mid-run: it pushes the wiki, force-pushes epub_deploy and pdf_deploy
  and nudges the website, and interrupting that can leave the three
  targets on different commits.
- timeout-minutes: 30, so a hung link check cannot burn six hours.
- pip cache. Marginal - five small pure-python wheels - but free.

Note make -j4 was tried and rejected: it cuts the build to 80s but
produces a wrong book, numbering the appendix 13 instead of 17 and
degrading a cross-reference to ??.
2026-08-24 02:06:06 -05:00
Lawrence Angrave d6977dd170 Re-enable the website trigger using a deploy key
The coursebook now publishes its wiki again, but nothing tells the
website to rebuild, so a change reaches the site only when someone
else pushes to it.

Restore that trigger with a deploy key (SITE_DEPLOY_KEY) rather than
the built-in token: GITHUB_TOKEN is scoped to this repo, and pushes
made with it deliberately do not trigger workflows. A deploy key also
has no expiry and is exempt from the org's SAML SSO, so it will not
silently lapse the way the old credentials did.

- point site_deploy.sh at cs341-illinois/cs341-illinois.github.io; it
  still named illinois-cs241, two renames stale
- add IdentitiesOnly so ssh cannot offer some other key
- seed known_hosts with ssh-keyscan instead of relying on the runner
- skip the site deploy when the secret is absent, so forks still pass
2026-08-23 22:27:42 -05:00
Lawrence Angrave c688b2dd43 Deploy with the built-in GITHUB_TOKEN instead of deploy keys
Every deploy has been failing at the push with "git@github.com:
Permission denied (publickey)". The repo has no deploy keys registered
at all, so the keys inside site-deploy.enc and wiki-deploy.enc cannot
authenticate - most likely lost in the illinois-cs241 ->
cs341-illinois org rename. GPG decryption itself still works, so
GPG_PASSPHRASE is not the problem.

Comment out the gpg/ssh-agent machinery and push over https with the
built-in GITHUB_TOKEN, granting the job contents: write. Nothing to
rotate, and it survives future renames.

site_deploy.sh stays disabled: it pushes to a different repo to nudge
the website into rebuilding, which GITHUB_TOKEN cannot do, and it still
names the twice-stale illinois-cs241/illinois-cs241.github.io.
2026-08-23 22:01:35 -05:00
Lawrence Angrave 31c92844bb Do not fail the build when a link cannot be reached
The WIKI build died on www.gnu.org with "[Errno 101] Network is
unreachable". gnu.org is not down: it has an AAAA record and GitHub
runners have no IPv6 route, so the connection fails before IPv4 is
tried. Reachability of the build machine is not a property of the book,
so warn and carry on instead of aborting.

Also add a 15s timeout - the failing host stalled the job for over two
minutes of retries - and report non-2xx as a warning. The previous
status test was `code < 200 and code > 299`, which no integer can
satisfy, so no status has ever been checked. It stays non-fatal
deliberately: www.gnu.org answers a bare requests HEAD with 403 (it
blocks the default user agent), so failing on non-2xx would break the
build on links that are perfectly fine in a browser.
2026-08-23 21:29:30 -05:00
Andrew Orals 660f9a4524 Update install.sh 2023-12-18 14:42:15 -06:00
Eric Zhang c88f52c716 Fix error in gen_wiki.py script (#190)
* Fix error in script

* Temp update CI to test out build

* Change back CI

* Add new workflow to test if builds work in a PR

* Fix formatting

* Update job name
2021-10-12 09:34:02 -07:00
Eric Zhang 8c49826577 Migrate to Github Actions (#184)
* Initial Github Actions workflow + script modifications

* Remove old keys

* Add deploy key

* Rename deploy key

* Oops add back

* Some changes after testing with website repo

* Remove env section

* Temporary changes for testing CI

* Enable github-actions on this branch for testing

* Fix?

* Only test out EPUB

* Fix?

* Fix?

* Update

* Typo and enable PDF

* Enable WIKI

* Add site deploy key

* Revert testing changes + Disable Github Actions on this branch

* Update README

* Typo

* Lowercase
2021-02-24 18:35:59 -08:00
Pradyumna Shome e7e70286a8 Make coursebook links open the raw file. 2020-09-03 13:51:22 -05:00
bhuvy a620438545 Updating references 2020-01-12 17:44:39 -08:00
bhuvy 8dccb0ba14 No forging commits 2019-07-31 11:55:52 -05:00
bhuvy 8c9a133fb0 Changing author and gen sidebar 2019-07-31 11:28:22 -05:00
bhuvy 8e2620daa5 Fixed bad wiki formatting 2019-07-25 15:33:05 -05:00
bhuvy 76ecffb2c1 Fixed caching issue 2019-07-23 14:20:57 -05:00
bhuvy 207754d371 Implementing link checking 2019-07-23 14:12:57 -05:00
bhuvy 490d07c0f0 Unbreaking the pdf build 2019-07-23 12:49:21 -05:00
bhuvy 7ca8cdd630 Fixed security error 2019-07-23 12:45:36 -05:00
bhuvy 3579e1adc9 Fixing css 2019-07-23 12:38:44 -05:00
bhuvy 9a58c035ab Alpha version of the epub 2019-07-23 12:27:37 -05:00
bhuvy 4e6f2e198c Fixed bad build caching 2019-07-23 11:23:11 -05:00
bhuvy 2fe67510de Python is being wild 2019-07-23 11:21:34 -05:00
bhuvy 6dd4896fa9 Debugging build 2019-07-23 11:20:08 -05:00
bhuvy 32f199f45d Odds and ends 2019-07-23 11:14:34 -05:00
bhuvy 40234abeb9 End to end beta of the scripts branch 2019-07-23 11:12:34 -05:00
bhuvy a51c5966d8 Revised install 2019-07-23 11:00:57 -05:00
bhuvy 1afb7a94be Revised syntax 2019-07-23 10:58:34 -05:00
bhuvy 79e1651aca Beta of epub build 2019-07-23 10:53:37 -05:00
Bhuvan Venkatesh 6de622f139 Merge pull request #134 from illinois-cs241/guiding_questions
Resolves #69
2019-07-09 14:12:39 -05:00
bhuvy 6607c04b9a Grammar style checks 2019-07-08 16:43:54 -05:00
bhuvy 23402389c8 Resolves #69 2019-07-07 16:46:56 -05:00
bhuvy 9f4df2f0e2 Adding is file check 2019-07-05 22:04:51 -05:00
bhuvy e6098c6d4d Merge branch 'master' into add/eps 2019-07-05 21:56:12 -05:00
bhuvy 521ba934a5 Converting to EPS 2019-07-05 21:54:44 -05:00
bhuvy c310516f6b Resolves #104 2019-07-05 19:59:45 -05:00
bhuvy 5e663de1c4 Resolves #100 2019-07-05 13:43:36 -05:00
Bhuvan Venkatesh d89530e9f1 Merge pull request #90 from illinois-cs241/figs/introc
Adding Figures to Introduction to C
2019-05-25 10:54:06 -05:00
Pradyumna Shome 5f1bc48714 Fixed "One Big File" 2019-05-24 16:51:11 +05:30
Pradyumna Shome bdfae76d8c Added width and height attributes.
Markdown does not process style tags from my observations, and the websites CSS rules make it so that the width and height attributes have lower precedence than one of the global CSS rules ( img:not(.emoji) { width: 100%} ).
Therefore, we need both (style) and (height and width) attributes.
2019-05-24 16:42:40 +05:30
Pradyumna Shome bf185d91d2 Fix PDF image size. 2019-05-24 16:23:19 +05:30
Pradyumna Shome 9546758f34 Close PDF image tag 2019-05-24 16:10:41 +05:30
bhuvy 3de545bcb5 Resolves #89 2019-05-23 21:10:50 -05:00
bhuvy 8484d62a6d Adding custom figures to introc 2019-05-23 20:16:32 -05:00
bhuvy f24b6c7e86 Yeet 2019-05-23 17:23:37 -05:00
bhuvy 65faa386e1 Adding duck png 2019-05-23 16:43:25 -05:00
bhuvy 8d6ca1a92d More hotfixes 2019-05-23 12:10:46 -05:00
Pradyumna Shome d24805afad Specify YAML loader 2019-05-21 14:19:55 +05:30
bhuvy add5bc1c7c Doesn't make sense in the third person: 2019-04-24 15:21:06 -05:00
Bhuvan Venkatesh c5a014c0e3 Update gen_wiki.py 2019-04-17 23:43:07 -05:00
bhuvy fbb138513b Alt tags 2019-03-24 16:51:22 -05:00
bhuvy 0d694d8f97 Fixing pdf spacing 2019-03-24 15:42:36 -05:00