Skip to content

Commit 2d34e73

Browse files
committed
Merge branch 'master' into addons
2 parents 348c602 + 6860685 commit 2d34e73

File tree

3 files changed

+146
-12
lines changed

3 files changed

+146
-12
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Based on the workflow by Brandon Patterson from https://github.com/mikemorran/hubs/blob/master/.github/workflows/ce-build.yml
2+
# Input masking referenced from https://dev.to/leading-edje/masking-input-parameters-in-github-actions-1ci
3+
4+
# Common registry base URLs:
5+
# Docker Hub: docker.io
6+
# GitHub: ghcr.io
7+
8+
name: custom-docker-build-push
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
Override_Registry_Base_URL:
14+
type: string
15+
Override_Registry_Username:
16+
type: string
17+
Override_Registry_Password:
18+
type: string
19+
Override_Registry_Namespace:
20+
type: string
21+
Override_Image_Tag:
22+
type: string
23+
Override_Dockerfile:
24+
type: string
25+
Override_Code_Path:
26+
type: string
27+
Use_Build_Cache:
28+
type: boolean
29+
default: true
30+
31+
# Add in default values for the inputs plus define any missing variables we need.
32+
# Everything should take their values from env rather than inputs.
33+
env:
34+
Registry_Base_URL: ${{ inputs.Override_Registry_Base_URL || vars.REGISTRY_BASE_URL }}
35+
# Registry_Username: This must be added in each job that needs it.
36+
# Registry_Password: This must be added in each job that needs it.
37+
Registry_Namespace: ${{ inputs.Override_Registry_Namespace || vars.REGISTRY_NAMESPACE }}
38+
Image_Tag: ${{ inputs.Override_Image_Tag || github.ref_name }}
39+
Dockerfile: ${{ inputs.Override_Dockerfile || 'RetPageOriginDockerfile' }}
40+
Code_Path: ${{ inputs.Override_Code_Path }}
41+
Use_Build_Cache: ${{ inputs.Use_Build_Cache }}
42+
# repo_name: This must be added in each job that needs it.
43+
44+
jobs:
45+
build:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
# Env variables
50+
- name: Assign username from secret
51+
if: ${{ inputs.Override_Registry_Username == ''}}
52+
run: |
53+
echo "Registry_Username=${{ secrets.REGISTRY_USERNAME }}" >> "$GITHUB_ENV"
54+
55+
- name: Assign username from input
56+
if: ${{ inputs.Override_Registry_Username != ''}}
57+
run: |
58+
USERNAME=$(jq -r '.inputs.Override_Registry_Username' $GITHUB_EVENT_PATH)
59+
echo ::add-mask::$USERNAME
60+
echo Registry_Username=$USERNAME >> $GITHUB_ENV
61+
62+
- name: Assign password from secret
63+
if: ${{ inputs.Override_Registry_Password == ''}}
64+
run: |
65+
echo "Registry_Password=${{ secrets.REGISTRY_PASSWORD }}" >> "$GITHUB_ENV"
66+
67+
- name: Assign password from input
68+
if: ${{ inputs.Override_Registry_Password != ''}}
69+
run: |
70+
PASSWORD=$(jq -r '.inputs.Override_Registry_Password' $GITHUB_EVENT_PATH)
71+
echo ::add-mask::$PASSWORD
72+
echo Registry_Password=$PASSWORD >> $GITHUB_ENV
73+
74+
- name: Add the repository name as an env variable
75+
run: |
76+
echo "repo_name=${GITHUB_REPOSITORY#*/}" >> "$GITHUB_ENV"
77+
78+
# Code
79+
- name: Checkout repository
80+
uses: actions/checkout@v4
81+
with:
82+
path: "./repo"
83+
84+
- name: Use Code_Path for multirepo
85+
if: ${{ env.Code_Path != ''}}
86+
run: |
87+
mkdir ./_repo
88+
cp -rf ./repo/${{ env.Code_Path }}/* ./_repo
89+
rm -rf ./repo
90+
mv ./_repo ./repo
91+
ls ./repo
92+
93+
# Docker
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v3
96+
with:
97+
install: true
98+
99+
- name: Login to container registry
100+
uses: docker/login-action@v3
101+
with:
102+
registry: ${{ env.Registry_Base_URL }}
103+
username: ${{ env.Registry_Username }}
104+
password: ${{ env.Registry_Password }}
105+
106+
- name: Docker Build and Push (with cache)
107+
if: ${{ fromJSON(env.Use_Build_Cache) == true }}
108+
uses: docker/build-push-action@v6
109+
with:
110+
context: repo/
111+
file: repo/${{ env.Dockerfile }}
112+
tags: ${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:${{ env.Image_Tag }}-latest,${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:${{ env.Image_Tag }}-${{ github.run_number }}
113+
cache-from: type=registry,ref=${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:buildcache
114+
cache-to: type=registry,ref=${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true
115+
push: true
116+
117+
- name: Docker Build and Push (no cache)
118+
if: ${{ fromJSON(env.Use_Build_Cache) == false }}
119+
uses: docker/build-push-action@v6
120+
with:
121+
context: repo/
122+
file: repo/${{ env.Dockerfile }}
123+
tags: ${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:${{ env.Image_Tag }}-latest,${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:${{ env.Image_Tag }}-${{ github.run_number }}
124+
push: true

src/react-components/room/ChatSidebar.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,30 +408,34 @@ function getMessageComponent(message, intl) {
408408
}
409409
case "video":
410410
return (
411-
<MessageBubble key={message.id} media>
412-
<video controls src={message.body.src} />
411+
<div className={styles.messageRow}>
412+
<MessageBubble key={message.id} media>
413+
<video controls src={message.body.src} />
414+
</MessageBubble>
413415
<IconButton
414416
className={styles.iconButton}
415417
onClick={onShareClick}
416418
title={intl.formatMessage({ id: "share-popover.title", defaultMessage: "Share" })}
417419
>
418420
<ShareIcon />
419421
</IconButton>
420-
</MessageBubble>
422+
</div>
421423
);
422424
case "image":
423425
case "photo":
424426
return (
425-
<MessageBubble key={message.id} media>
426-
<img src={message.body.src} />
427+
<div className={styles.messageRow}>
428+
<MessageBubble key={message.id} media>
429+
<img src={message.body.src} />
430+
</MessageBubble>
427431
<IconButton
428432
className={styles.iconButton}
429433
onClick={onShareClick}
430434
title={intl.formatMessage({ id: "share-popover.title", defaultMessage: "Share" })}
431435
>
432436
<ShareIcon />
433437
</IconButton>
434-
</MessageBubble>
438+
</div>
435439
);
436440
case "permission":
437441
return (

src/react-components/room/ChatSidebar.scss

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,21 @@
4040
flex-direction: column;
4141
}
4242

43+
:local(.message-row) {
44+
display: flex;
45+
flex-direction: row;
46+
justify-content: start;
47+
}
48+
4349
:local(.message-bubble) {
4450
background-color: theme.$chat-bubble-bg-color-received;
4551
border-radius: 19px;
4652
margin: 2px;
4753
padding: 10px 16px;
4854
max-width: 80%;
4955
width: max-content;
50-
display: flex;
51-
flex-direction: row;
52-
justify-content: start;
5356
font-size: theme.$font-size-md;
54-
overflow-wrap: anywhere;
57+
overflow-wrap: break-word;
5558
line-height: 1.25;
5659

5760
img,
@@ -70,12 +73,15 @@
7073
align-self: flex-end;
7174
}
7275

76+
:local(.message-row) {
77+
flex-direction: row-reverse;
78+
justify-content: end;
79+
}
80+
7381
:local(.message-bubble) {
7482
background-color: theme.$chat-bubble-bg-color-sent;
7583
color: theme.$chat-bubble-text-color-sent;
7684
align-self: flex-end;
77-
flex-direction: row-reverse;
78-
justify-content: end;
7985

8086
a {
8187
color: theme.$chat-bubble-text-color-sent;

0 commit comments

Comments
 (0)