Skip to content

Commit

Permalink
something is gonna change
Browse files Browse the repository at this point in the history
  • Loading branch information
darioalessandro committed Aug 25, 2024
1 parent d0ee6e2 commit 94e4b76
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 18 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/upload-website-docker-hub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Website to Docker image

on:
pull_request:
paths:
- '*'
# push:
# branches:
# - main
# paths:
# - 'website/**'
# - docker/Dockerfile.website

jobs:
push_to_registry:
name: Push Website Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
id: checkout

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract SHA
id: extract_sha
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA::8})"

- name: Extract branch name
id: extract_branch
run: echo "::set-output name=branch::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"

- name: Build and push UI Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: website/.
file: docker/Dockerfile.website
push: true
tags: securityunion/video-call-rs-website:${{ steps.extract_branch.outputs.branch }}-${{ steps.extract_sha.outputs.sha8 }}
33 changes: 33 additions & 0 deletions docker/Dockerfile.website
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM --platform=linux/amd64 rust:1.74-slim-bookworm as builder

RUN rustup default nightly
RUN rustup target add wasm32-unknown-unknown

RUN apt-get update && apt-get install -y \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*

RUN cargo install cargo-leptos

WORKDIR /app

COPY . .

RUN cargo leptos build --release

FROM --platform=linux/amd64 debian:bookworm-slim

# Copy the server binary to the /app directory
COPY --from=builder /app/target/release/leptos-website /app/
# /target/site contains our JS/WASM/CSS, etc.
COPY --from=builder /app/target/site /app/site
# Copy Cargo.toml if it’s needed at runtime
COPY --from=builder /app/Cargo.toml /app/
WORKDIR /app
ENV RUST_LOG="info"
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"
ENV LEPTOS_SITE_ROOT="site"
EXPOSE 8080

CMD ["/app/leptos-website"]
15 changes: 0 additions & 15 deletions leptos-website/.github/workflows/fly.yml

This file was deleted.

22 changes: 22 additions & 0 deletions leptos-website/LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
MIT License

Copyright (c) 2024 Security Union LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

MIT License

Copyright (c) 2022 Greg Johnston

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
4 changes: 4 additions & 0 deletions leptos-website/build_and_push_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TAG=$(git rev-parse --short HEAD)
echo "Building and pushing docker image with tag $TAG"
docker build -v -f ../docker/Dockerfile.website -t securityunion/video-call-rs-website:$TAG .
docker push securityunion/video-call-rs-website:$TAG
1 change: 0 additions & 1 deletion leptos-website/public/images/header_logo.svg

This file was deleted.

1 change: 0 additions & 1 deletion leptos-website/public/images/leptos_circle.svg

This file was deleted.

1 change: 0 additions & 1 deletion leptos-website/public/images/leptos_sphere.svg

This file was deleted.

0 comments on commit 94e4b76

Please sign in to comment.