Skip to content

Commit dab1a01

Browse files
committed
ci: rebuild website workflow without the texlive Docker image
The pipeline shelled out to a hand-maintained 3.4 GB texlive build-env image on Docker Hub (last rebuilt 2019, Node ~2019). The Jun-7 Hexo 8 / chokidar 4 upgrade needs Node >= 20.19, so that stale container failed at 'Cannot find module fs/promises'. Replace it with a native, Docker-free workflow: checkout@v4 + setup-node@v4 (Node 22, npm cache), npm ci, build the Hexo site, and deploy over SSH with the existing SERVER_* secrets. The website needs only Node and Python 3, so no texlive is required. PDF/epub are no longer rebuilt in CI; the copies on the server are left untouched (scp overwrites, never deletes) so their download links keep working.
1 parent 490a6ac commit dab1a01

1 file changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/website.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,38 @@ jobs:
99
build:
1010
name: Website
1111
runs-on: ubuntu-latest
12-
timeout-minutes: 60
12+
timeout-minutes: 20
1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: build
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
cache: npm
20+
cache-dependency-path: website/package-lock.json
21+
22+
# The Hexo site only needs Node and Python 3 (preinstalled on the
23+
# runner). The old pipeline shelled out to a hand-maintained 3.4 GB
24+
# texlive Docker image just to also build the PDF/epub; that image
25+
# silently drifted to a 2019 Node and broke the build. We deploy the
26+
# website only here. The PDF/epub already on the server are left in
27+
# place (scp overwrites, never deletes), so their download links keep
28+
# working until those artifacts are rebuilt separately.
29+
- name: Install website dependencies
30+
run: npm ci --prefix website
31+
32+
- name: Build website
33+
run: cd website && make
34+
35+
- name: Deploy to server
1636
env:
1737
USER: ${{ secrets.SERVER_USER }}
1838
TARGET: ${{ secrets.SERVER_PATH }}
1939
KEY: ${{ secrets.SERVER_KEY }}
2040
DOMAIN: ${{ secrets.SERVER_DOMAIN }}
2141
run: |
22-
make build
23-
mkdir ~/.ssh
42+
mkdir -p ~/.ssh
2443
echo "$KEY" | tr -d '\r' > ~/.ssh/id_ed25519
2544
chmod 400 ~/.ssh/id_ed25519
26-
eval "$(ssh-agent -s)"
27-
ssh-add ~/.ssh/id_ed25519
28-
ssh-keyscan -H $DOMAIN >> ~/.ssh/known_hosts
29-
scp -r website/public/modern-cpp/* $USER@$DOMAIN:$TARGET
45+
ssh-keyscan -H "$DOMAIN" >> ~/.ssh/known_hosts
46+
scp -i ~/.ssh/id_ed25519 -r website/public/modern-cpp/* "$USER@$DOMAIN:$TARGET"

0 commit comments

Comments
 (0)