Skip to content

Commit 3b95bf7

Browse files
committed
fix: docker images
1 parent 20c5c29 commit 3b95bf7

3 files changed

Lines changed: 33 additions & 23 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches: [dev]
66
tags:
77
- 'sable/v*'
8+
pull_request:
9+
paths:
10+
- 'Dockerfile'
11+
- '.github/workflows/docker-publish.yml'
812

913
env:
1014
REGISTRY: ghcr.io
@@ -27,6 +31,7 @@ jobs:
2731
persist-credentials: false
2832

2933
- name: Log in to GitHub Container Registry
34+
if: github.event_name != 'pull_request'
3035
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
3136
with:
3237
registry: ${{ env.REGISTRY }}
@@ -62,21 +67,23 @@ jobs:
6267
type=semver,pattern={{major}}.{{minor}},value=${{ steps.release_tag.outputs.value }},enable=${{ steps.release_tag.outputs.is_release == 'true' }}
6368
type=semver,pattern={{major}},value=${{ steps.release_tag.outputs.value }},enable=${{ steps.release_tag.outputs.is_release == 'true' && !startsWith(steps.release_tag.outputs.value, 'v0.') }}
6469
65-
- name: Compute short SHA
66-
id: vars
67-
run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
70+
# TODO: CI build temporarily disabled — site is now built inside Docker.
71+
# Re-enable these steps (and build-contexts below) once we move the build back to CI.
72+
# - name: Compute short SHA
73+
# id: vars
74+
# run: echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
6875

69-
- name: Setup app
70-
uses: ./.github/actions/setup
71-
with:
72-
install-command: pnpm install --frozen-lockfile --ignore-scripts
76+
# - name: Setup app
77+
# uses: ./.github/actions/setup
78+
# with:
79+
# install-command: pnpm install --frozen-lockfile --ignore-scripts
7380

74-
- name: Build site
75-
env:
76-
VITE_BUILD_HASH: ${{ steps.vars.outputs.short_sha }}
77-
VITE_IS_RELEASE_TAG: ${{ steps.release_tag.outputs.is_release }}
78-
run: |
79-
NODE_OPTIONS=--max_old_space_size=4096 pnpm run build
81+
# - name: Build site
82+
# env:
83+
# VITE_BUILD_HASH: ${{ steps.vars.outputs.short_sha }}
84+
# VITE_IS_RELEASE_TAG: ${{ steps.release_tag.outputs.is_release }}
85+
# run: |
86+
# NODE_OPTIONS=--max_old_space_size=4096 pnpm run build
8087

8188
- name: Set up QEMU
8289
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
@@ -89,16 +96,18 @@ jobs:
8996
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
9097
with:
9198
context: .
92-
push: true
99+
push: ${{ github.event_name != 'pull_request' }}
93100
platforms: linux/amd64,linux/arm64
94101
tags: ${{ steps.meta.outputs.tags }}
95102
labels: ${{ steps.meta.outputs.labels }}
96103
cache-from: type=gha
97104
cache-to: type=gha,mode=max
98-
build-contexts: |
99-
site-dist=./dist
105+
# TODO: re-enable once CI build is restored
106+
# build-contexts: |
107+
# site-dist=./dist
100108

101109
- name: Generate artifact attestation
110+
if: github.event_name != 'pull_request'
102111
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
103112
with:
104113
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM --platform=$BUILDPLATFORM node:24.13.1-alpine AS base
33
ENV PNPM_HOME="/pnpm"
44
ENV PATH="$PNPM_HOME:$PATH"
55
RUN corepack enable
6+
RUN apk add --no-cache git
67

78
## Builder
89
FROM base AS builder
@@ -13,10 +14,10 @@ ARG VITE_BUILD_HASH
1314
ARG VITE_IS_RELEASE_TAG=false
1415
ENV VITE_BUILD_HASH=$VITE_BUILD_HASH
1516
ENV VITE_IS_RELEASE_TAG=$VITE_IS_RELEASE_TAG
16-
COPY pnpm-lock.yaml /src/
17+
COPY pnpm-lock.yaml pnpm-workspace.yaml /src/
1718
RUN pnpm fetch
1819
COPY . /src/
19-
RUN pnpm install --offline --frozen-lockfile --ignore-scripts
20+
RUN pnpm install --offline --frozen-lockfile
2021
ENV NODE_OPTIONS=--max_old_space_size=4096
2122
RUN pnpm run build
2223

vite.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ const copyFiles = {
9393
const require = createRequire(import.meta.url);
9494

9595
function serverMatrixSdkCryptoWasm() {
96-
const resolvedPath = path.join(
97-
path.dirname(require.resolve('@matrix-org/matrix-sdk-crypto-wasm')),
98-
'pkg/matrix_sdk_crypto_wasm_bg.wasm'
99-
);
100-
10196
return {
10297
name: 'vite-plugin-serve-matrix-sdk-crypto-wasm',
10398
configureServer(server: ViteDevServer) {
99+
const resolvedPath = path.join(
100+
path.dirname(require.resolve('@matrix-org/matrix-sdk-crypto-wasm')),
101+
'pkg/matrix_sdk_crypto_wasm_bg.wasm'
102+
);
103+
104104
server.middlewares.use((req, res, next) => {
105105
if (!req.url?.endsWith('matrix_sdk_crypto_wasm_bg.wasm')) {
106106
next();

0 commit comments

Comments
 (0)