Fix CI: host-mode runner has no Node.js for actions/checkout
Host-mode jobs run directly in the runner container instead of a spawned per-job container, so JS actions like actions/checkout@v4 have no Node.js runtime to execute with. Replace it with a plain git fetch/checkout in the deploy job.
This commit is contained in:
1 parent
3a79c3d6c1
commit
71e638b459
2 files changed
+15
-1
No files matched your search
+10
-1
@@ -40,7 +40,16 @@ jobs:
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
runs-on: host
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# Not actions/checkout@v4: it's a JS action and host-mode jobs run
|
||||
# directly in the runner container, which has git but no Node.js.
|
||||
- name: Checkout
|
||||
run: |
|
||||
rm -rf .git * .[!.]* 2>/dev/null
|
||||
git init -q
|
||||
git remote add origin "${{ gitea.server_url }}/${{ gitea.repository }}.git"
|
||||
git -c http.extraHeader="Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
fetch --depth 1 origin "${{ gitea.sha }}"
|
||||
git checkout -q FETCH_HEAD
|
||||
|
||||
# /srv/docker/maptool is the same path inside the runner container and
|
||||
# on the real host (1:1 bind mount) — required so the relative bind
|
||||
|
||||
@@ -112,6 +112,11 @@ of Puma's bind address.
|
||||
`.gitea/workflows/ci.yml`'s `deploy` job runs after `check` passes, only
|
||||
on a push to `main`, with `runs-on: host`:
|
||||
|
||||
. Checks out the repo with plain `git` (`fetch` + `checkout`,
|
||||
authenticated via a one-off `http.extraHeader`), not
|
||||
`actions/checkout@v4` — that's a JS action, and host-mode jobs run
|
||||
directly in the runner container, which has `git` but no Node.js
|
||||
runtime to execute JS actions with.
|
||||
. Copies the checkout into `/srv/docker/maptool/` using plain
|
||||
`cp`/`rm` (no `rsync` in the runner image): clears everything in the
|
||||
target except `data/`, copies the fresh checkout over, then drops
|
||||
|
||||
Reference in new issue
Block a user