File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 13
13
14
14
name : Check and Lint - bevy_mod_scripting
15
15
16
+
17
+ env :
18
+
19
+ REGISTRY : ghcr.io
20
+ IMAGE_NAME : bevy-mod-scripting
21
+
16
22
concurrency :
17
23
# Use github.run_id on main branch
18
24
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
@@ -21,6 +27,37 @@ concurrency:
21
27
cancel-in-progress : true
22
28
23
29
jobs :
30
+
31
+ build-ci-image :
32
+ runs-on : ubuntu-latest
33
+ # if: github.ref == 'refs/heads/main' || github.ref == 'staging'
34
+ permissions :
35
+ contents : read
36
+ packages : write
37
+ steps :
38
+ - name : Checkout repository
39
+ uses : actions/checkout@v4
40
+ - name : Log into registry ${{ env.REGISTRY }}
41
+ if : github.event_name != 'pull_request'
42
+ uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
43
+ with :
44
+ registry : ${{ env.REGISTRY }}
45
+ username : ${{ github.repository_owner }}
46
+ password : ${{ secrets.GITHUB_TOKEN }}
47
+ - name : Extract Docker metadata
48
+ id : meta
49
+ uses : docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
50
+ with :
51
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
52
+ - name : Build and push Docker image
53
+ uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
54
+ with :
55
+ context : .
56
+ push : true
57
+ file : ./crates/xtask/Dockerfile
58
+ tags : ${{ steps.meta.outputs.tags }}
59
+ labels : ${{ steps.meta.outputs.labels }}
60
+
24
61
generate-job-matrix :
25
62
runs-on : ubuntu-latest
26
63
outputs :
Original file line number Diff line number Diff line change
1
+ FROM rust:latest AS base
2
+ RUN cargo install sccache --version ^0.7
3
+ RUN cargo install cargo-chef --version ^0.1
4
+ ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
5
+
6
+ FROM base AS planner
7
+ WORKDIR /app
8
+ COPY . .
9
+ RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
10
+ cargo chef prepare --recipe-path recipe.json
11
+
12
+ FROM base as builder
13
+ WORKDIR /app
14
+ COPY --from=planner /app/recipe.json recipe.json
15
+ RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
16
+ cargo chef cook --release --recipe-path recipe.json
17
+ COPY . .
18
+ RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
19
+ cargo xtask init
You can’t perform that action at this time.
0 commit comments