Skip to content

Commit

Permalink
Merge branch 'master' into addons
Browse files Browse the repository at this point in the history
  • Loading branch information
Exairnous committed Dec 29, 2024
2 parents 348c602 + 6860685 commit 2d34e73
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 12 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/custom-docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Based on the workflow by Brandon Patterson from https://github.com/mikemorran/hubs/blob/master/.github/workflows/ce-build.yml
# Input masking referenced from https://dev.to/leading-edje/masking-input-parameters-in-github-actions-1ci

# Common registry base URLs:
# Docker Hub: docker.io
# GitHub: ghcr.io

name: custom-docker-build-push

on:
workflow_dispatch:
inputs:
Override_Registry_Base_URL:
type: string
Override_Registry_Username:
type: string
Override_Registry_Password:
type: string
Override_Registry_Namespace:
type: string
Override_Image_Tag:
type: string
Override_Dockerfile:
type: string
Override_Code_Path:
type: string
Use_Build_Cache:
type: boolean
default: true

# Add in default values for the inputs plus define any missing variables we need.
# Everything should take their values from env rather than inputs.
env:
Registry_Base_URL: ${{ inputs.Override_Registry_Base_URL || vars.REGISTRY_BASE_URL }}
# Registry_Username: This must be added in each job that needs it.
# Registry_Password: This must be added in each job that needs it.
Registry_Namespace: ${{ inputs.Override_Registry_Namespace || vars.REGISTRY_NAMESPACE }}
Image_Tag: ${{ inputs.Override_Image_Tag || github.ref_name }}
Dockerfile: ${{ inputs.Override_Dockerfile || 'RetPageOriginDockerfile' }}
Code_Path: ${{ inputs.Override_Code_Path }}
Use_Build_Cache: ${{ inputs.Use_Build_Cache }}
# repo_name: This must be added in each job that needs it.

jobs:
build:
runs-on: ubuntu-latest

steps:
# Env variables
- name: Assign username from secret
if: ${{ inputs.Override_Registry_Username == ''}}
run: |
echo "Registry_Username=${{ secrets.REGISTRY_USERNAME }}" >> "$GITHUB_ENV"
- name: Assign username from input
if: ${{ inputs.Override_Registry_Username != ''}}
run: |
USERNAME=$(jq -r '.inputs.Override_Registry_Username' $GITHUB_EVENT_PATH)
echo ::add-mask::$USERNAME
echo Registry_Username=$USERNAME >> $GITHUB_ENV
- name: Assign password from secret
if: ${{ inputs.Override_Registry_Password == ''}}
run: |
echo "Registry_Password=${{ secrets.REGISTRY_PASSWORD }}" >> "$GITHUB_ENV"
- name: Assign password from input
if: ${{ inputs.Override_Registry_Password != ''}}
run: |
PASSWORD=$(jq -r '.inputs.Override_Registry_Password' $GITHUB_EVENT_PATH)
echo ::add-mask::$PASSWORD
echo Registry_Password=$PASSWORD >> $GITHUB_ENV
- name: Add the repository name as an env variable
run: |
echo "repo_name=${GITHUB_REPOSITORY#*/}" >> "$GITHUB_ENV"
# Code
- name: Checkout repository
uses: actions/checkout@v4
with:
path: "./repo"

- name: Use Code_Path for multirepo
if: ${{ env.Code_Path != ''}}
run: |
mkdir ./_repo
cp -rf ./repo/${{ env.Code_Path }}/* ./_repo
rm -rf ./repo
mv ./_repo ./repo
ls ./repo
# Docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true

- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ env.Registry_Base_URL }}
username: ${{ env.Registry_Username }}
password: ${{ env.Registry_Password }}

- name: Docker Build and Push (with cache)
if: ${{ fromJSON(env.Use_Build_Cache) == true }}
uses: docker/build-push-action@v6
with:
context: repo/
file: repo/${{ env.Dockerfile }}
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 }}
cache-from: type=registry,ref=${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:buildcache
cache-to: type=registry,ref=${{ env.Registry_Base_URL }}/${{ env.Registry_Namespace }}/${{ env.repo_name }}:buildcache,mode=max,image-manifest=true,oci-mediatypes=true
push: true

- name: Docker Build and Push (no cache)
if: ${{ fromJSON(env.Use_Build_Cache) == false }}
uses: docker/build-push-action@v6
with:
context: repo/
file: repo/${{ env.Dockerfile }}
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 }}
push: true
16 changes: 10 additions & 6 deletions src/react-components/room/ChatSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,30 +408,34 @@ function getMessageComponent(message, intl) {
}
case "video":
return (
<MessageBubble key={message.id} media>
<video controls src={message.body.src} />
<div className={styles.messageRow}>
<MessageBubble key={message.id} media>
<video controls src={message.body.src} />
</MessageBubble>
<IconButton
className={styles.iconButton}
onClick={onShareClick}
title={intl.formatMessage({ id: "share-popover.title", defaultMessage: "Share" })}
>
<ShareIcon />
</IconButton>
</MessageBubble>
</div>
);
case "image":
case "photo":
return (
<MessageBubble key={message.id} media>
<img src={message.body.src} />
<div className={styles.messageRow}>
<MessageBubble key={message.id} media>
<img src={message.body.src} />
</MessageBubble>
<IconButton
className={styles.iconButton}
onClick={onShareClick}
title={intl.formatMessage({ id: "share-popover.title", defaultMessage: "Share" })}
>
<ShareIcon />
</IconButton>
</MessageBubble>
</div>
);
case "permission":
return (
Expand Down
18 changes: 12 additions & 6 deletions src/react-components/room/ChatSidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,21 @@
flex-direction: column;
}

:local(.message-row) {
display: flex;
flex-direction: row;
justify-content: start;
}

:local(.message-bubble) {
background-color: theme.$chat-bubble-bg-color-received;
border-radius: 19px;
margin: 2px;
padding: 10px 16px;
max-width: 80%;
width: max-content;
display: flex;
flex-direction: row;
justify-content: start;
font-size: theme.$font-size-md;
overflow-wrap: anywhere;
overflow-wrap: break-word;
line-height: 1.25;

img,
Expand All @@ -70,12 +73,15 @@
align-self: flex-end;
}

:local(.message-row) {
flex-direction: row-reverse;
justify-content: end;
}

:local(.message-bubble) {
background-color: theme.$chat-bubble-bg-color-sent;
color: theme.$chat-bubble-text-color-sent;
align-self: flex-end;
flex-direction: row-reverse;
justify-content: end;

a {
color: theme.$chat-bubble-text-color-sent;
Expand Down

0 comments on commit 2d34e73

Please sign in to comment.