File tree Expand file tree Collapse file tree 3 files changed +36
-28
lines changed
Expand file tree Collapse file tree 3 files changed +36
-28
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 55 tags : ["v[0-9]+.[0-9]+.[0-9]+*"]
66 workflow_dispatch :
77
8+ env :
9+ DATABASE_URL : " sqlite://rebot.sqlite3?mode=rwc"
10+ CARGO_TERM_COLOR : always
11+
812jobs :
913 release :
1014 runs-on : ubuntu-latest
1317 packages : write
1418
1519 steps :
20+ - uses : actions/checkout@v4
21+
22+ - uses : actions/cache@v4
23+ with :
24+ path : |
25+ ~/.cargo/bin/
26+ ~/.cargo/registry/index/
27+ ~/.cargo/registry/cache/
28+ ~/.cargo/git/db/
29+ target/
30+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
31+
32+ - name : Install sqlx-cli
33+ run : |
34+ SQLX_CLI_VERSION="$(sed -rn 's/^sqlx = \{ version = "([0-9.]+)".*$/\1/p' Cargo.toml)"
35+ echo "Required sqlx-cli version: $SQLX_CLI_VERSION"
36+ cargo install sqlx-cli --force --version "$SQLX_CLI_VERSION" --no-default-features --features sqlite
37+
38+ - name : Set Up the Database
39+ run : sqlx database setup
40+
41+ - name : Build
42+ run : cargo build --profile release
43+
44+ - name : Test
45+ run : cargo test --profile release
46+
1647 - name : Log in to the Container registry
1748 uses : docker/login-action@v3
1849 with :
2354 - name : Set up Docker Buildx
2455 uses : docker/setup-buildx-action@v3
2556
26- - name : Build and push
57+ - name : Build and Push
2758 uses : docker/build-push-action@v6
2859 with :
60+ context : .
2961 push : true
3062 tags : " ${{ vars.IMAGE_REGISTRY }}/${{ vars.IMAGE_NAME }}:latest,${{ vars.IMAGE_REGISTRY }}/${{ vars.IMAGE_NAME }}:${{ github.ref_name }}"
31- cache-from : type=gha
32- cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 1- FROM lukemathwalker/cargo-chef:0.1.72-rust-1.88.0-bookworm AS chef
2- WORKDIR /app
3-
4- FROM chef AS planner
5- COPY . .
6- RUN cargo chef prepare --recipe-path recipe.json
7-
8- FROM chef AS builder
9- COPY --from=planner /app/recipe.json recipe.json
10-
11- RUN cargo chef cook --release --recipe-path recipe.json
12-
13- COPY . .
14-
15- RUN DATABASE_URL="sqlite://rebot.sqlite3?mode=rwc" cargo build --release
16-
171FROM gcr.io/distroless/cc-debian12
182
19- COPY --from=builder /app/target/release/rating-exchange-bot /
3+ ARG PROFILE=release
4+
5+ COPY ./target/${PROFILE}/rating-exchange-bot /rating-exchange-bot
206
217CMD ["./rating-exchange-bot" ]
You can’t perform that action at this time.
0 commit comments