vectordb/.github/workflows/force-docker-build.yml

63 lines
1.6 KiB
YAML

name: Manual Docker Build
on:
workflow_dispatch:
inputs:
release_token:
description: 'Your release token'
required: true
triggered_by:
description: 'CD | TAG | MANUAL'
required: false
default: MANUAL
jobs:
token-check:
runs-on: ubuntu-latest
steps:
- name: Check release token
id: token-check
run: |
touch SUCCESS
if: inputs.release_token == env.release_token
env:
release_token: ${{ secrets.VECTORDB_RELEASE_TOKEN }}
- name: Fail release token
run: |
[[ -f SUCCESS ]]
regular-release:
needs: token-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.5.0
with:
fetch-depth: 100
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Get vectordb version
run: |
pip install -e .
echo "VECTORDB_VERSION=$(python -c 'import vectordb; print(vectordb.__version__)')" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_DEVBOT_USER }}
password: ${{ secrets.DOCKERHUB_DEVBOT_PWD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
push: true
context: .
file: Dockerfiles/vectordb.Dockerfile
tags: jinaai/vectordb:latest, jinaai/vectordb:${{ env.VECTORDB_VERSION }}