-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
47 lines (38 loc) · 1.06 KB
/
action.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
name: Run ollama server
description: Run an ollama server with the model you provide
branding:
icon: 'arrow-down'
color: 'orange'
inputs:
model:
description: The model to run
required: true
cache-key:
description: The cache key to use
required: false
default: ''
runs:
using: composite
steps:
- id: cache-ollama-install
uses: actions/cache@v4
with:
path: ./.ollama-install
key: ollama-install-${{ inputs.cache-key }}
- id: cache-ollama-models
uses: actions/cache@v4
with:
path: ~/.ollama
key: ollama-models-${{ inputs.cache-key }}-${{ inputs.model }}
- if: steps.cache-ollama-install.outputs.cache-hit != 'true'
run: '${GITHUB_ACTION_PATH}/install-ollama.sh'
shell: bash
- run: echo $(pwd)/.ollama-install/bin >> $GITHUB_PATH
shell: bash
- run: ollama start &
shell: bash
- run: ollama --version
shell: bash
- if: steps.cache-ollama-models.outputs.cache-hit != 'true'
run: ollama pull ${{ inputs.model }}
shell: bash