Skip to content

Commit

Permalink
fix: Remove redundant steps
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowballXueQiu committed Aug 30, 2023
1 parent 49a4ce4 commit 5fad445
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Move `src` and `Cargo.toml`
run: |
cd /home
sudo mkdir app
cd app
mkdir src
cd /
sudo mv /home/runner/work/VastseaBackendServer/VastseaBackendServer/src /home/app
sudo mv /home/runner/work/VastseaBackendServer/VastseaBackendServer/Cargo.toml /home/app/
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ FROM rust:latest as build
WORKDIR /home/app

# Copy the Rust Project Files to Docker Image
COPY ./Cargo.toml ./Cargo.toml
COPY ./src ./src
COPY ./Cargo.toml ./
COPY ./src ./

# Set up Target Environment variable
ENV OUT_DIR /home/app/target/
ENV OUT_DIR /home/app/target

# Cargo build Rust Project
RUN cargo build --release
Expand All @@ -31,12 +31,12 @@ RUN \

# Copy the binary files into Docker Image
# Please replace the specific path according to your needs
COPY --from=build /home/app/target/release/ /home/BackendServer
COPY --from=build /home/app/target/release /home/BackendServer

# Clean up build cache
RUN \
apt-get clean && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*

CMD ["bash", "cd /home/BackendServer"]
CMD ["bash"]

0 comments on commit 5fad445

Please sign in to comment.