-
Notifications
You must be signed in to change notification settings - Fork 5
28 lines (26 loc) · 1 KB
/
ollama-upgrade.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
name: Ollama Upgrade
on:
workflow_dispatch:
push:
schedule:
- cron: '0 0 * * 1'
jobs:
updater:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Latest Version
run: |
sudo apt-get update
sudo apt-get install -y curl jq
echo "OLLAMA_LATEST=$(curl -s 'https://hub.docker.com/v2/repositories/ollama/ollama/tags' | jq '.results[] | select(.name|test("[0-9].[0-9].[0-9]")) | .name' | head -n 1 | tr -d '"')" >> $GITHUB_ENV
- name: Upgrade
run: |
sed -i -E 's/ollama\/ollama:[0-9].[0-9].[0-9]/ollama\/ollama:'$OLLAMA_LATEST'/g' docker-compose.yml
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add docker-compose.yml
git commit -am "chore: auto upgrade ollama" || echo "We're good for now. See you next time!"
git pull --rebase
git push