-
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.64 KB
/
docker-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and Publish Docker Image
on:
pull_request:
branches:
- main
# push:
# branches:
# - main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Build blue_onyx binaries
run: |
cargo build --release --bin blue_onyx
cargo build --release --bin blue_onyx_download_models
- name: Download models
run: |
./target/release/blue_onyx_download_models /tmp/models
./target/release/blue_onyx_download_models /tmp/models custom-model
- name: Prepare Docker context
run: |
mkdir docker-context
cp ./target/release/blue_onyx docker-context/
cp -r /tmp/models docker-context/models
cp ./Dockerfile docker-context/
- name: Get blue_onyx version
id: get_version
run: |
VERSION=$(./target/release/blue_onyx --version | awk '{print $2}')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: docker-context
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/blue_onyx:latest
ghcr.io/${{ github.repository_owner }}/blue_onyx:${{ env.VERSION }}