Skip to content

Commit 52c04f2

Browse files
fix website publish (#254)
* fix website push * save * install leptos * blackberry * massive restructuring * got build to work * keep trying
1 parent 11c1f3d commit 52c04f2

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
name: Publish Website to Docker image
22

33
on:
4-
# pull_request:
5-
# paths:
6-
# - '*'
4+
pull_request:
5+
paths:
6+
- 'leptos-website/**'
7+
- 'docker/Dockerfile.website'
78
push:
89
branches:
910
- main
1011
paths:
1112
- 'leptos-website/**'
12-
- docker/Dockerfile.website
13+
- 'docker/Dockerfile.website'
1314

1415
jobs:
15-
push_to_registry:
16-
name: Push Website Docker image to Docker Hub
16+
build_and_push:
17+
name: Build and Push Website Docker image
1718
runs-on: ubuntu-latest
1819
steps:
1920
- name: Check out the repo
2021
uses: actions/checkout@v3
2122
id: checkout
2223

2324
- name: Log in to Docker Hub
25+
if: github.event_name == 'push'
2426
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
2527
with:
2628
username: ${{ secrets.DOCKER_USERNAME }}
@@ -34,12 +36,12 @@ jobs:
3436
id: extract_branch
3537
run: echo "::set-output name=branch::${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
3638

37-
- name: Build and push UI Docker image
39+
- name: Build and push Website Docker image
3840
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
3941
with:
40-
context: ./leptos-website
42+
context: .
4143
file: docker/Dockerfile.website
42-
push: true
44+
push: ${{ github.event_name == 'push' }}
4345
tags: |
4446
securityunion/video-call-rs-website:${{ steps.extract_branch.outputs.branch }}-${{ steps.extract_sha.outputs.sha8 }}
4547
securityunion/video-call-rs-website:latest

docker/Dockerfile.website

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@ RUN apt-get update && apt-get install -y \
1111

1212
RUN cargo install cargo-leptos --version 0.2.20
1313

14-
WORKDIR /app
14+
WORKDIR /app/leptos-website
1515

16-
COPY . .
16+
COPY leptos-website .
1717

18+
RUN cargo install -f wasm-bindgen-cli --version 0.2.93
1819
RUN cargo leptos build --release
1920

2021
FROM debian:bookworm-slim
2122

2223
# Copy the server binary to the /app directory
23-
COPY --from=builder /app/target/release/leptos_website /app/
24+
COPY --from=builder /app/leptos-website/target/release/leptos_website /app/
2425
# /target/site contains our JS/WASM/CSS, etc.
25-
COPY --from=builder /app/target/site /app/site
26-
# Copy Cargo.toml if its needed at runtime
27-
COPY --from=builder /app/Cargo.toml /app/
26+
COPY --from=builder /app/leptos-website/target/site /app/site
27+
# Copy Cargo.toml if it's needed at runtime
28+
COPY --from=builder /app/leptos-website/Cargo.toml /app/
2829
WORKDIR /app
2930
ENV RUST_LOG="info"
3031
ENV LEPTOS_SITE_ADDR="0.0.0.0:8080"

docker/Dockerfile.website.dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ RUN apt-get update && apt-get install -y \
99
g++ \
1010
&& rm -rf /var/lib/apt/lists/*
1111

12-
RUN cargo install cargo-leptos --version 0.2.20
12+
RUN cargo install cargo-leptos --version 0.2.29
13+
RUN cargo install wasm-bindgen-cli --version 0.2.100
1314

1415
RUN cargo install trunk --version 0.17.5
1516

leptos-website/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sqlx = { version = "0.6.2", features = [
4545
"sqlite",
4646
], optional = true }
4747
thiserror = "1.0.38"
48-
wasm-bindgen = "0.2.100"
48+
wasm-bindgen = "=0.2.93"
4949
femark = { version = "=0.1.3", optional = true }
5050
axum-extra = { version = "0.7.4", optional = true, features = ["cookie"] }
5151
web-sys = { version = "0.3", optional = true, features = [

0 commit comments

Comments
 (0)