chore(ci): forge git.extract.team + restore EXTRA_DOMAINS/cache-from/INSTALL_SH after sync
This commit is contained in:
parent
c7afb9c564
commit
48aa3a3dd8
1 changed files with 26 additions and 4 deletions
30
action.yml
30
action.yml
|
|
@ -36,8 +36,8 @@ runs:
|
|||
VJSON: ${{ inputs.vars_json }}
|
||||
run: |
|
||||
set -eu
|
||||
FORGE_HOST="git.154.83.149.72.nip.io"
|
||||
OUR_IP="154.83.149.72"
|
||||
FORGE_HOST="git.extract.team"
|
||||
OUR_IP="51.161.128.94"
|
||||
|
||||
echo "::group::setup"
|
||||
# platform-ci-base bakes in git/jq/dig/rsync/bun — skip apk on the fast path,
|
||||
|
|
@ -140,9 +140,25 @@ runs:
|
|||
fi
|
||||
fi
|
||||
|
||||
# ---- extra domains (EXTRA_DOMAINS=alias1.com,alias2.com in .env) ----
|
||||
# Serve the SAME site on additional domains, each with its own auto-TLS cert.
|
||||
# Point each domain's A-record at the platform IP. www is NOT auto-added for
|
||||
# extras — list "www.alias.com" explicitly if you want it.
|
||||
if [ -n "${EXTRA_DOMAINS:-}" ]; then
|
||||
OLDIFS=$IFS; IFS=', '
|
||||
for ed in ${EXTRA_DOMAINS}; do
|
||||
[ -z "$ed" ] && continue
|
||||
SITE_ADDR="$SITE_ADDR, $ed"
|
||||
echo " extra domain: + $ed"
|
||||
dig +short A "$ed" 2>/dev/null | grep -q "$OUR_IP" \
|
||||
|| echo "::warning::$ed has no A→$OUR_IP yet — add the DNS record; TLS issues once it resolves"
|
||||
done
|
||||
IFS=$OLDIFS
|
||||
fi
|
||||
|
||||
# ---- domain collision pre-check: clear error instead of a raw caddy
|
||||
# "ambiguous site definition" when another deploy already serves this domain ----
|
||||
for dom in "$DOMAIN" ${ALT:+"$ALT"}; do
|
||||
for dom in $(printf '%s' "$SITE_ADDR" | tr ',' ' '); do
|
||||
for frag in /srv/platform/caddy/sites/*.caddy; do
|
||||
[ -f "$frag" ] || continue
|
||||
base=$(basename "$frag")
|
||||
|
|
@ -215,7 +231,13 @@ runs:
|
|||
[ -f Dockerfile ] || { echo "::error::DEPLOY=$DT needs a Dockerfile in repo root"; exit 1; }
|
||||
echo "::group::docker build"
|
||||
IMG="platform/${SLUG}:${SHA}"
|
||||
docker build -t "$IMG" -t "platform/${SLUG}:latest" /tmp/repo
|
||||
# BuildKit ON: enables --mount=type=cache in the repo's Dockerfile and
|
||||
# layer reuse from the previous :latest (inline cache) → fast rebuilds when
|
||||
# deps/layers are unchanged. First build of a repo just misses the cache.
|
||||
DOCKER_BUILDKIT=1 docker build \
|
||||
--cache-from "platform/${SLUG}:latest" \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
-t "$IMG" -t "platform/${SLUG}:latest" /tmp/repo
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::run container"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue