generated from security-union/yew-actix-template
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0ee6e2
commit 94e4b76
Showing
8 changed files
with
102 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.