Skip to content

Commit 24b3f2b

Browse files
committed
Production frontend build
1 parent 5e323e3 commit 24b3f2b

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

.github/workflows/canister-tests.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,21 @@ jobs:
4444
# NOTE: if you modify the flavors, update the #flavors table in README.md
4545
matrix:
4646
include:
47-
# The production build
47+
# The production backend build
4848
- name: internet_identity_production.wasm.gz
4949
II_FETCH_ROOT_KEY: 0
5050
II_DUMMY_CAPTCHA: 0
5151
II_DUMMY_AUTH: 0
5252
II_DEV_CSP: 0
53+
II_SPLIT_FRONTEND: 0
54+
55+
# The production frontend build
56+
- name: internet_identity_frontend_production.wasm.gz
57+
II_FETCH_ROOT_KEY: 0
58+
II_DUMMY_CAPTCHA: 0
59+
II_DUMMY_AUTH: 0
60+
II_DEV_CSP: 0
61+
II_SPLIT_FRONTEND: 1
5362

5463
# No captcha and fetching the root key, used in (our) tests, backend and
5564
# e2e.
@@ -58,6 +67,7 @@ jobs:
5867
II_DUMMY_CAPTCHA: 1
5968
II_DUMMY_AUTH: 0
6069
II_DEV_CSP: 0
70+
II_SPLIT_FRONTEND: 0
6171

6272
# Everything disabled, used by third party developers who only care
6373
# about the login flow
@@ -66,6 +76,7 @@ jobs:
6676
II_DUMMY_CAPTCHA: 1
6777
II_DUMMY_AUTH: 1
6878
II_DEV_CSP: 1
79+
II_SPLIT_FRONTEND: 0
6980

7081
steps:
7182
- uses: actions/checkout@v4
@@ -90,6 +101,7 @@ jobs:
90101
II_DUMMY_AUTH=${{ matrix.II_DUMMY_AUTH }}
91102
II_DUMMY_CAPTCHA=${{ matrix.II_DUMMY_CAPTCHA }}
92103
II_DEV_CSP=${{ matrix.II_DEV_CSP }}
104+
II_SPLIT_FRONTEND=${{ matrix.II_SPLIT_FRONTEND }}
93105
II_VERSION=${{ steps.version.outputs.version }}
94106
cache-from: type=gha,scope=cached-stage
95107
# Exports the artefacts from the final stage

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ENV TZ=UTC
1212
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \
1313
apt -yq update && \
1414
apt -yqq install --no-install-recommends curl ca-certificates \
15-
build-essential pkg-config libssl-dev llvm-dev liblmdb-dev clang cmake jq
15+
build-essential pkg-config libssl-dev llvm-dev liblmdb-dev clang cmake jq
1616

1717
# Install node
1818
RUN curl --fail -sSf https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
@@ -83,11 +83,17 @@ ARG II_FETCH_ROOT_KEY=
8383
ARG II_DUMMY_CAPTCHA=
8484
ARG II_DUMMY_AUTH=
8585
ARG II_DEV_CSP=
86+
ARG II_SPLIT_FRONTEND=
8687

8788
RUN touch src/*/src/lib.rs
8889
RUN npm ci
8990

90-
RUN ./scripts/build
91+
RUN if [ -n "$II_SPLIT_FRONTEND" ]; then \
92+
./scripts/build --frontend && \
93+
mv /internet_identity_frontend.wasm.gz /internet_identity.wasm.gz; \
94+
else \
95+
./scripts/build; \
96+
fi
9197
RUN sha256sum /internet_identity.wasm.gz
9298

9399
FROM deps as build_archive

0 commit comments

Comments
 (0)