ci: remove apt dependency + force LAN DNS in job container
This commit is contained in:
@@ -10,22 +10,28 @@ jobs:
|
|||||||
build-and-anchors:
|
build-and-anchors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:20-bookworm-slim
|
# Image avec node + git déjà présents -> pas d'APT
|
||||||
|
image: mcr.microsoft.com/devcontainers/javascript-node:20-bookworm
|
||||||
|
# On force root pour pouvoir écrire /etc/resolv.conf (sinon user "node")
|
||||||
options: >-
|
options: >-
|
||||||
--dns=192.168.1.1
|
--user root
|
||||||
--dns=109.0.66.10
|
--add-host gitea.archicratie.trans-hands.synology.me:192.168.1.20
|
||||||
--dns-option=timeout:2
|
|
||||||
--dns-option=attempts:2
|
|
||||||
--dns-option=use-vc
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install base tools (git + certs)
|
- name: Force DNS inside job container (DS220+ / act_runner)
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -euo pipefail
|
||||||
apt-get update
|
echo "== resolv.conf (before) =="; cat /etc/resolv.conf || true
|
||||||
apt-get install -y --no-install-recommends git ca-certificates
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
# IMPORTANT: on enlève 1.1.1.1/9.9.9.9 qui time-out chez toi
|
||||||
git --version
|
cat > /etc/resolv.conf <<'EOF'
|
||||||
|
nameserver 192.168.1.1
|
||||||
|
nameserver 109.0.66.10
|
||||||
|
options timeout:2 attempts:2
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "== resolv.conf (after) =="; cat /etc/resolv.conf
|
||||||
|
node -e 'require("dns").resolve4("deb.debian.org",(e,a)=>console.log("dns",e||a))'
|
||||||
|
|
||||||
- name: Checkout (from Gitea, no external actions)
|
- name: Checkout (from Gitea, no external actions)
|
||||||
env:
|
env:
|
||||||
@@ -35,7 +41,6 @@ jobs:
|
|||||||
TOKEN: ${{ secrets.CI_TOKEN }}
|
TOKEN: ${{ secrets.CI_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [ -n "${TOKEN:-}" ]; then
|
if [ -n "${TOKEN:-}" ]; then
|
||||||
AUTH="$(printf "oauth2:%s" "$TOKEN" | base64 | tr -d '\n')"
|
AUTH="$(printf "oauth2:%s" "$TOKEN" | base64 | tr -d '\n')"
|
||||||
git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER/$REPO.git" .
|
git -c http.extraHeader="AUTHORIZATION: basic $AUTH" clone "$SERVER/$REPO.git" .
|
||||||
@@ -43,7 +48,6 @@ jobs:
|
|||||||
echo "ℹ️ CI_TOKEN absent → clone sans auth (repo public ou accès runner déjà OK)."
|
echo "ℹ️ CI_TOKEN absent → clone sans auth (repo public ou accès runner déjà OK)."
|
||||||
git clone "$SERVER/$REPO.git" .
|
git clone "$SERVER/$REPO.git" .
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git checkout "$SHA"
|
git checkout "$SHA"
|
||||||
|
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
|
|||||||
Reference in New Issue
Block a user