mirror of
https://github.com/open-webui/open-webui
synced 2025-05-01 11:26:00 +00:00
Add github actions script
This commit is contained in:
parent
7678489c08
commit
bcb874fdb0
49
.github/workflows/docker-build-push.yml
vendored
Normal file
49
.github/workflows/docker-build-push.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
type=sha,format=long
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
LITELLM_BASE_URL=/litellm
|
@ -17,12 +17,7 @@ services:
|
||||
- host.docker.internal:host-gateway
|
||||
|
||||
open-webui:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
LITELLM_BASE_URL: '/litellm'
|
||||
dockerfile: Dockerfile
|
||||
image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
|
||||
image: ghcr.io/${GITHUB_REPOSITORY}:main
|
||||
container_name: open-webui
|
||||
volumes:
|
||||
- ./backend/data:/app/backend/data
|
||||
|
Loading…
Reference in New Issue
Block a user