-
Notifications
You must be signed in to change notification settings - Fork 34
80 lines (71 loc) · 1.99 KB
/
build-ollama-serve.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build and deploy ollama server
on:
push:
branches:
- main
- ollama-serve
paths:
- ".github/workflows/build-ollama-serve.yml"
- "ollama-serve/**"
pull_request:
branches:
- main
paths:
- ".github/workflows/build-ollama-serve.yml"
- "ollama-serve/**"
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
working-directory: ./ollama-serve/
jobs:
build_and_push:
name: Build and push images
runs-on:
- self-hosted
- dind
- large-8x8
outputs:
short_sha: ${{ steps.versions.outputs.SHORT_SHA }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set version strings
id: versions
run: |
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay
uses: docker/login-action@v2
with:
registry: quay.io/tembo
username: ${{ secrets.QUAY_USER_TEMBO }}
password: ${{ secrets.QUAY_PASSWORD_TEMBO }}
- name: Build and push -- Commit
# push a build for every commit
uses: docker/build-push-action@v5
with:
file: ./ollama-serve/Dockerfile
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
quay.io/tembo/ollama-serve:${{ steps.versions.outputs.SHORT_SHA }}
- name: Build and push -- Latest
# only push latest off main
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v5
with:
file: ./ollama-serve/Dockerfile
context: .
platforms: linux/amd64, linux/arm64
push: true
tags: |
quay.io/tembo/ollama-serve:latest