Skip to content

Commit 80cb635

Browse files
committed
Build and push Github container registry image
This will be used to generate the themes from our template repos
1 parent 4cef1c9 commit 80cb635

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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: Get latest tag
16+
id: get-latest-tag
17+
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0 --match 'v*.*.*')" >> $GITHUB_ENV
18+
19+
- name: Build Docker image
20+
run: docker build -t tinted-builder-rust .
21+
22+
- name: Tag Docker image
23+
run: docker tag tinted-builder-rust ghcr.io/tinted-theming/tinted-builder-rust:${{ env.LATEST_TAG }}
24+
25+
- name: Log in to GitHub Container Registry
26+
run: echo ${{ secrets.DOCKER_GHCR }} | docker login ghcr.io -u tinted-theming-bot --password-stdin
27+
28+
- name: Push Docker image
29+
run: docker push ghcr.io/tinted-themuing/tinted-builder-rust:${{ env.LATEST_TAG }}

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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"]

0 commit comments

Comments
 (0)