Skip to content

Mirror Releases

Mirror Releases #176

Workflow file for this run

name: Mirror Releases
"on":
schedule:
- cron: "56 13 * * *"
workflow_dispatch:
jobs:
mirror:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
variant:
- ""
- "-cuda"
- "-ollama"
steps:
# https://github.com/actions/github-script
- name: Fetch repository info
id: latest-tag
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const response = await github.rest.repos.listTags({
owner: "open-webui",
repo: "open-webui",
per_page: 1
});
const tags = response.data;
if (tags.length === 0) {
throw new Error('No tags found in the repository. Stopping the workflow.');
}
return tags[0].name;
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/login-action
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: backplane/open-webui
flavor: |
latest=false
suffix=${{ matrix.variant }}
tags: |
type=semver,pattern={{version}},value=${{ steps.latest-tag.outputs.result }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.latest-tag.outputs.result }}
type=semver,pattern={{major}},value=${{ steps.latest-tag.outputs.result }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
org.opencontainers.image.licenses=MIT
org.opencontainers.image.description=mirror of GHCR images posted at https://github.com/open-webui/open-webui/pkgs/container/open-webui
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
VARIANT=${{ matrix.variant }}
SEMVER=${{ steps.latest-tag.outputs.result }}
update-readme:
runs-on: ubuntu-latest
needs: mirror
steps:
# https://github.com/actions/checkout
- name: Checkout repository
uses: actions/checkout@v4
# https://github.com/peter-evans/dockerhub-description
- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: backplane/open-webui