Build application outside docker for ci.

This commit is contained in:
Kavin 2022-10-25 10:19:41 +01:00
parent cccc095de8
commit f4d8e01841
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD
2 changed files with 20 additions and 1 deletions

View File

@ -12,6 +12,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Build Cargo
run: cargo build --release && mv target/release/sponsorblock-mirror .
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
with: with:
@ -30,7 +33,7 @@ jobs:
uses: docker/build-push-action@v3 uses: docker/build-push-action@v3
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile.ci
platforms: linux/amd64 platforms: linux/amd64
push: true push: true
tags: 1337kavin/sponsorblock-mirror:latest tags: 1337kavin/sponsorblock-mirror:latest

16
Dockerfile.ci Normal file
View File

@ -0,0 +1,16 @@
FROM debian:stable-slim
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && \
apt-get install -y --no-install-recommends \
libssl1.1 libpq5 ca-certificates && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app/
COPY ./sponsorblock-mirror .
COPY ./Rocket.toml .
EXPOSE 8000
CMD ["/app/sponsorblock-mirror"]