File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Update Docker image
2
+ on :
3
+ workflow_dispatch :
4
+
5
+ jobs :
6
+ push-image :
7
+ name : Push latest image
8
+ runs-on : ubuntu-latest
9
+ outputs :
10
+ cargo_cache_key : ${{ steps.cargo_cache_key.outputs.value }}
11
+ steps :
12
+ - name : Checkout code
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Fetch all tags
16
+ run : git fetch --tags
17
+
18
+ - name : Get latest tag
19
+ id : get-latest-tag
20
+ run : |
21
+ LATEST_TAG=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -n 1)
22
+ echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV
23
+ echo "Latest tag: ${LATEST_TAG}"
24
+
25
+ - name : Verify LATEST_TAG
26
+ run : echo "LATEST_TAG is ${{ env.LATEST_TAG }}"
27
+
28
+ - name : Build Docker image
29
+ run : docker build -t tinted-builder-rust .
30
+
31
+ - name : Tag Docker image
32
+ run : docker tag tinted-builder-rust ghcr.io/tinted-theming/tinted-builder-rust:${{ env.LATEST_TAG }}
33
+
34
+ - name : Log in to GitHub Container Registry
35
+ run : echo ${{ secrets.DOCKER_GHCR }} | docker login ghcr.io -u tinted-theming-bot --password-stdin
36
+
37
+ - name : Push Docker image
38
+ run : docker push ghcr.io/tinted-themuing/tinted-builder-rust:${{ env.LATEST_TAG }}
Original file line number Diff line number Diff line change
1
+ FROM rust:latest as builder
2
+ WORKDIR /usr/src/tinted-builder-rust
3
+
4
+ # Copy required compilation source
5
+ COPY Cargo.toml Cargo.lock ./
6
+ COPY tinted-builder ./tinted-builder
7
+ COPY tinted-builder-rust ./tinted-builder-rust
8
+
9
+ # Build and test
10
+ RUN cargo build -p tinted-builder-rust --release
11
+ RUN cargo test -p tinted-builder-rust --release
12
+
13
+ FROM rust:latest
14
+ COPY --from=builder /usr/src/tinted-builder-rust/target/release/tinted-builder-rust /usr/local/bin/tinted-builder-rust
15
+
16
+ ENTRYPOINT ["tinted-builder-rust" ]
You can’t perform that action at this time.
0 commit comments