-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and push Github container registry image
This will be used to generate the themes from our template repos
- Loading branch information
1 parent
4cef1c9
commit 80cb635
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Update Docker image | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
push-image: | ||
name: Push latest image | ||
runs-on: ubuntu-latest | ||
outputs: | ||
cargo_cache_key: ${{ steps.cargo_cache_key.outputs.value }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get latest tag | ||
id: get-latest-tag | ||
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0 --match 'v*.*.*')" >> $GITHUB_ENV | ||
|
||
- name: Build Docker image | ||
run: docker build -t tinted-builder-rust . | ||
|
||
- name: Tag Docker image | ||
run: docker tag tinted-builder-rust ghcr.io/tinted-theming/tinted-builder-rust:${{ env.LATEST_TAG }} | ||
|
||
- name: Log in to GitHub Container Registry | ||
run: echo ${{ secrets.DOCKER_GHCR }} | docker login ghcr.io -u tinted-theming-bot --password-stdin | ||
|
||
- name: Push Docker image | ||
run: docker push ghcr.io/tinted-themuing/tinted-builder-rust:${{ env.LATEST_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM rust:latest as builder | ||
WORKDIR /usr/src/tinted-builder-rust | ||
|
||
# Copy required compilation source | ||
COPY Cargo.toml Cargo.lock ./ | ||
COPY tinted-builder ./tinted-builder | ||
COPY tinted-builder-rust ./tinted-builder-rust | ||
|
||
# Build and test | ||
RUN cargo build -p tinted-builder-rust --release | ||
RUN cargo test -p tinted-builder-rust --release | ||
|
||
FROM rust:latest | ||
COPY --from=builder /usr/src/tinted-builder-rust/target/release/tinted-builder-rust /usr/local/bin/tinted-builder-rust | ||
|
||
ENTRYPOINT ["tinted-builder-rust"] |