ci: replace build-stage.sh concatenation with elb build from ci-base
- stage.yaml and deploy.yaml now extract El SDK from ci-base (docker cp /opt/el) and run elb build to produce dist/neuron-landing - JS El sources compiled via elc --target=js in a dedicated step, matching dev.yaml exactly - build-stage.sh replaced with thin elb wrapper for local dev use - Removes the broken "Set up El SDK" stub (echo EL_HOME) and old build-stage.sh invocation from both workflows
This commit is contained in:
@@ -62,10 +62,6 @@ jobs:
|
||||
echo "=> Full build required"
|
||||
fi
|
||||
|
||||
- name: Set up El SDK
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: echo "EL_HOME=/opt/el" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Authenticate to GCP
|
||||
id: auth
|
||||
uses: google-github-actions/auth@v2
|
||||
@@ -102,12 +98,60 @@ jobs:
|
||||
# in the build context for Dockerfile COPY to succeed.
|
||||
run: touch src/index.html src/about.html src/terms.html src/enterprise-terms.html
|
||||
|
||||
- name: Build image (build-stage.sh)
|
||||
# ── El SDK setup ──────────────────────────────────────────────────────
|
||||
|
||||
- name: Extract El SDK from ci-base
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
env:
|
||||
EXTRACT_JS: '1'
|
||||
run: |
|
||||
./build-stage.sh "${{ steps.tag.outputs.tag }}"
|
||||
set -euo pipefail
|
||||
docker pull us-central1-docker.pkg.dev/neuron-785695/neuron-ci/ci-base:latest
|
||||
CID=$(docker create us-central1-docker.pkg.dev/neuron-785695/neuron-ci/ci-base:latest)
|
||||
sudo mkdir -p /opt/el
|
||||
docker cp "$CID:/opt/el" /opt/
|
||||
docker rm "$CID"
|
||||
echo "ELB=/opt/el/dist/bin/elb" >> "$GITHUB_ENV"
|
||||
echo "ELC=/opt/el/dist/platform/elc" >> "$GITHUB_ENV"
|
||||
echo "EL_RUNTIME=/opt/el/el-compiler/runtime" >> "$GITHUB_ENV"
|
||||
|
||||
# ── Build neuron-web binary ───────────────────────────────────────────
|
||||
|
||||
- name: Build neuron-web with elb
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
"$ELB" build \
|
||||
--elc "$ELC" \
|
||||
--runtime "$EL_RUNTIME"
|
||||
echo "Binary: $(ls -lh dist/neuron-landing)"
|
||||
|
||||
# ── Compile JS client sources ─────────────────────────────────────────
|
||||
|
||||
- name: Compile JS El sources
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cp "$EL_RUNTIME/el_runtime.js" src/js/
|
||||
mkdir -p dist/js
|
||||
for f in src/js/*.el; do
|
||||
[ -f "$f" ] || continue
|
||||
name=$(basename "$f" .el)
|
||||
"$ELC" --target=js --bundle --minify --obfuscate "$f" > "dist/js/${name}.js"
|
||||
echo " compiled: $f -> dist/js/${name}.js"
|
||||
done
|
||||
rm -f src/js/el_runtime.js
|
||||
|
||||
# ── Docker build + push ───────────────────────────────────────────────
|
||||
|
||||
- name: Build and tag image
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker build \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
--cache-from us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:latest \
|
||||
-f Dockerfile.stage \
|
||||
-t "marketing:${{ steps.tag.outputs.tag }}" \
|
||||
.
|
||||
docker tag "marketing:${{ steps.tag.outputs.tag }}" "${{ steps.tag.outputs.image }}"
|
||||
docker tag "marketing:${{ steps.tag.outputs.tag }}" "us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:latest"
|
||||
|
||||
|
||||
@@ -72,10 +72,6 @@ jobs:
|
||||
echo "=> Full build required"
|
||||
fi
|
||||
|
||||
- name: Set up El SDK
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: echo "EL_HOME=/opt/el" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Authenticate to GCP
|
||||
uses: google-github-actions/auth@v2
|
||||
with:
|
||||
@@ -104,10 +100,60 @@ jobs:
|
||||
# in the build context for Dockerfile COPY to succeed.
|
||||
run: touch src/index.html src/about.html src/terms.html src/enterprise-terms.html
|
||||
|
||||
- name: Build image (build-stage.sh)
|
||||
# ── El SDK setup ──────────────────────────────────────────────────────
|
||||
|
||||
- name: Extract El SDK from ci-base
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
./build-stage.sh "${{ steps.tag.outputs.tag }}"
|
||||
set -euo pipefail
|
||||
docker pull us-central1-docker.pkg.dev/neuron-785695/neuron-ci/ci-base:latest
|
||||
CID=$(docker create us-central1-docker.pkg.dev/neuron-785695/neuron-ci/ci-base:latest)
|
||||
sudo mkdir -p /opt/el
|
||||
docker cp "$CID:/opt/el" /opt/
|
||||
docker rm "$CID"
|
||||
echo "ELB=/opt/el/dist/bin/elb" >> "$GITHUB_ENV"
|
||||
echo "ELC=/opt/el/dist/platform/elc" >> "$GITHUB_ENV"
|
||||
echo "EL_RUNTIME=/opt/el/el-compiler/runtime" >> "$GITHUB_ENV"
|
||||
|
||||
# ── Build neuron-web binary ───────────────────────────────────────────
|
||||
|
||||
- name: Build neuron-web with elb
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
"$ELB" build \
|
||||
--elc "$ELC" \
|
||||
--runtime "$EL_RUNTIME"
|
||||
echo "Binary: $(ls -lh dist/neuron-landing)"
|
||||
|
||||
# ── Compile JS client sources ─────────────────────────────────────────
|
||||
|
||||
- name: Compile JS El sources
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cp "$EL_RUNTIME/el_runtime.js" src/js/
|
||||
mkdir -p dist/js
|
||||
for f in src/js/*.el; do
|
||||
[ -f "$f" ] || continue
|
||||
name=$(basename "$f" .el)
|
||||
"$ELC" --target=js --bundle --minify --obfuscate "$f" > "dist/js/${name}.js"
|
||||
echo " compiled: $f -> dist/js/${name}.js"
|
||||
done
|
||||
rm -f src/js/el_runtime.js
|
||||
|
||||
# ── Docker build + push ───────────────────────────────────────────────
|
||||
|
||||
- name: Build and tag image
|
||||
if: steps.changetype.outputs.asset_only != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker build \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
--cache-from us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:stage-latest \
|
||||
-f Dockerfile.stage \
|
||||
-t "marketing:${{ steps.tag.outputs.tag }}" \
|
||||
.
|
||||
docker tag "marketing:${{ steps.tag.outputs.tag }}" "${{ steps.tag.outputs.image }}"
|
||||
docker tag "marketing:${{ steps.tag.outputs.tag }}" "us-central1-docker.pkg.dev/neuron-785695/neuron-marketing/marketing:stage-latest"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user