Skip to content

Commit 94e4b76

Browse files
something is gonna change
1 parent d0ee6e2 commit 94e4b76

File tree

8 files changed

+102
-18
lines changed

8 files changed

+102
-18
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish Website to Docker image
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '*'
7+
# push:
8+
# branches:
9+
# - main
10+
# paths:
11+
# - 'website/**'
12+
# - docker/Dockerfile.website
13+
14+
jobs:
15+
push_to_registry:
16+
name: Push Website Docker image to Docker Hub
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out the repo
20+
uses: actions/checkout@v3
21+
id: checkout
22+
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
25+
with:
26+
username: ${{ secrets.DOCKER_USERNAME }}
27+
password: ${{ secrets.DOCKER_PASSWORD }}
28+
29+
- name: Extract SHA
30+
id: extract_sha
31+
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA::8})"
32+
33+
- name: Extract branch name
34+
id: extract_branch
35+
run: echo "::set-output name=branch::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
36+
37+
- name: Build and push UI Docker image
38+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
39+
with:
40+
context: website/.
41+
file: docker/Dockerfile.website
42+
push: true
43+
tags: securityunion/video-call-rs-website:${{ steps.extract_branch.outputs.branch }}-${{ steps.extract_sha.outputs.sha8 }}

docker/Dockerfile.website

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM --platform=linux/amd64 rust:1.74-slim-bookworm as builder
2+
3+
RUN rustup default nightly
4+
RUN rustup target add wasm32-unknown-unknown
5+
6+
RUN apt-get update && apt-get install -y \
7+
libssl-dev \
8+
pkg-config \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
RUN cargo install cargo-leptos
12+
13+
WORKDIR /app
14+
15+
COPY . .
16+
17+
RUN cargo leptos build --release
18+
19+
FROM --platform=linux/amd64 debian:bookworm-slim
20+
21+
# Copy the server binary to the /app directory
22+
COPY --from=builder /app/target/release/leptos-website /app/
23+
# /target/site contains our JS/WASM/CSS, etc.
24+
COPY --from=builder /app/target/site /app/site
25+
# Copy Cargo.toml if it’s needed at runtime
26+
COPY --from=builder /app/Cargo.toml /app/
27+
WORKDIR /app
28+
ENV RUST_LOG="info"
29+
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"
30+
ENV LEPTOS_SITE_ROOT="site"
31+
EXPOSE 8080
32+
33+
CMD ["/app/leptos-website"]

leptos-website/.github/workflows/fly.yml

-15
This file was deleted.

leptos-website/LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
MIT License
22

3+
Copyright (c) 2024 Security Union LLC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
MIT License
24+
325
Copyright (c) 2022 Greg Johnston
426

527
Permission is hereby granted, free of charge, to any person obtaining a copy
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
TAG=$(git rev-parse --short HEAD)
2+
echo "Building and pushing docker image with tag $TAG"
3+
docker build -v -f ../docker/Dockerfile.website -t securityunion/video-call-rs-website:$TAG .
4+
docker push securityunion/video-call-rs-website:$TAG

leptos-website/public/images/header_logo.svg

-1
This file was deleted.

leptos-website/public/images/leptos_circle.svg

-1
This file was deleted.

leptos-website/public/images/leptos_sphere.svg

-1
This file was deleted.

0 commit comments

Comments
 (0)