-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (47 loc) · 1.28 KB
/
ollama.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
name: ollama
on:
push:
workflow_dispatch:
jobs:
ollama:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Make ollama models directory
run: |
mkdir -p ~/.ollama/models
- name: Cache Ollama models
id: cache-ollama-models
uses: actions/cache@v4
with:
path: ~/.ollama
key: ${{ runner.os }}-ollama
- name: Install Ollama
env:
OLLAMA_MODELS: ~/.ollama/models
run: |
curl -fsSL https://ollama.com/install.sh | sudo -E sh
sudo systemctl stop ollama.service
- name: Change permissions
run: |
sudo chown -R ollama:ollama ~/.ollama
sudo chmod -R 777 ~/.ollama
- name: Start serving
env:
OLLAMA_MODELS: ~/.ollama/models
run: |
ollama serve &
sleep 5
time curl -i http://localhost:11434
- name: Pull gemma2:2b
env:
OLLAMA_MODELS: ~/.ollama/models
run: |
ollama pull gemma2:2b
- name: Invoke gemma2:2b
env:
OLLAMA_MODELS: ~/.ollama/models
run: |
ollama run gemma2:2b "Who is the current Secretary General of the United Nations?"