Skip to content

Commit c63e6ec

Browse files
committed
Add github workflows
1 parent 09ee6f6 commit c63e6ec

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: Your Informative Title Here
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
30+
**Smartphone (please complete the following information):**
31+
- Device: [e.g. iPhone6]
32+
- OS: [e.g. iOS8.1]
33+
- Browser [e.g. stock browser, safari]
34+
35+
**Additional context**
36+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/publish-docker.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Publish Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*' # Push events to tags matching v*, i.e. v1.0, v20.15.10
9+
10+
jobs:
11+
build-and-push:
12+
name: Build and Push Docker Image
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write # Needed for GHCR
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
22+
- name: Set up QEMU
23+
uses: docker/setup-qemu-action@v2
24+
with:
25+
platforms: 'arm64,amd64'
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v2
29+
id: buildx
30+
with:
31+
install: true
32+
33+
- name: Extract metadata (tags, labels)
34+
id: meta
35+
uses: docker/metadata-action@v4
36+
with:
37+
images: |
38+
gitmotion/ollama-api-server
39+
ghcr.io/${{ github.repository }}
40+
tags: |
41+
type=semver,pattern={{version}}
42+
type=semver,pattern={{major}}.{{minor}}
43+
type=raw,value=latest,enable={{is_default_branch}}
44+
45+
- name: Set Package Version
46+
id: package_version
47+
run: |
48+
VERSION=$(node -p "require('./package.json').version")
49+
echo "VERSION=$VERSION" >> $GITHUB_ENV
50+
echo "version=$VERSION" >> $GITHUB_OUTPUT
51+
52+
- name: Login to Docker Hub
53+
uses: docker/login-action@v2
54+
with:
55+
username: ${{ secrets.DOCKERHUB_USERNAME }}
56+
password: ${{ secrets.DOCKERHUB_TOKEN }}
57+
58+
- name: Login to GitHub Container Registry
59+
uses: docker/login-action@v2
60+
with:
61+
registry: ghcr.io
62+
username: ${{ github.repository_owner }}
63+
password: ${{ secrets.GH_TOKEN }}
64+
65+
- name: Build and push Docker image
66+
uses: docker/build-push-action@v4
67+
with:
68+
context: .
69+
push: true
70+
platforms: linux/amd64,linux/arm64
71+
tags: |
72+
gitmotion/ollama-api-server:latest
73+
gitmotion/ollama-api-server:${{ env.VERSION }}
74+
ghcr.io/${{ github.repository }}:latest
75+
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
76+
labels: ${{ steps.meta.outputs.labels }}
77+
cache-from: type=gha
78+
cache-to: type=gha,mode=max
79+
build-args: |
80+
VERSION=${{ env.VERSION }}
81+
82+
- name: Update Docker Hub Description
83+
uses: peter-evans/dockerhub-description@v3
84+
with:
85+
username: ${{ secrets.DOCKERHUB_USERNAME }}
86+
password: ${{ secrets.DOCKERHUB_TOKEN }}
87+
repository: gitmotion/ollama-api-server
88+
short-description: "Expose a local 🦙 ollama api behind defined api keys - easy setup with docker!"
89+
readme-filepath: ./README.md

0 commit comments

Comments
 (0)