Monthly All-in-One Image Build #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Monthly All-in-One Image Build | |
on: | |
schedule: | |
# Run on the 1st day of each month | |
- cron: "0 0 1 * *" | |
workflow_dispatch: # Allow manual triggers | |
jobs: | |
versions: | |
runs-on: ubuntu-latest | |
outputs: | |
VCHORDBM25: ${{ steps.versions.outputs.VCHORDBM25 }} | |
PGTOKENIZER: ${{ steps.versions.outputs.PGTOKENIZER }} | |
VCHORD: ${{ steps.versions.outputs.VCHORD }} | |
PGVECTOR: ${{ steps.versions.outputs.PGVECTOR }} | |
DATE_TAG: ${{ steps.versions.outputs.DATE_TAG }} | |
steps: | |
- name: Get latest release versions | |
id: versions | |
run: | | |
VCHORDBM25=$(curl -s https://api.github.com/repos/tensorchord/VectorChord-bm25/releases/latest | jq -r '.tag_name' | sed 's/^v//') | |
echo "VCHORDBM25=${VCHORDBM25}" >> $GITHUB_OUTPUT | |
PGTOKENIZER=$(curl -s https://api.github.com/repos/tensorchord/pg_tokenizer.rs/releases/latest | jq -r '.tag_name' | sed 's/^v//') | |
echo "PGTOKENIZER=${PGTOKENIZER}" >> $GITHUB_OUTPUT | |
VCHORD=$(curl -s https://api.github.com/repos/tensorchord/VectorChord/releases/latest | jq -r '.tag_name' | sed 's/^v//') | |
echo "VCHORD=${VCHORD}" >> $GITHUB_OUTPUT | |
PGVECTOR=$(curl -s https://api.github.com/repos/pgvector/pgvector/tags | jq -r '.[0].name' | sed 's/^v//') | |
echo "PGVECTOR=${PGVECTOR}" >> $GITHUB_OUTPUT | |
DATE_TAG=$(date +'%Y%m%d') | |
echo "DATE_TAG=${DATE_TAG}" >> $GITHUB_OUTPUT | |
docker: | |
needs: ["versions"] | |
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm' }} | |
strategy: | |
matrix: | |
pg_major: ["14", "15", "16", "17", "18"] | |
platform: ["amd64", "arm64"] | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push build to Docker Registry | |
uses: docker/build-push-action@v6 | |
with: | |
context: ./vchord-suite | |
push: true | |
platforms: linux/${{ matrix.platform }} | |
provenance: false | |
tags: | | |
tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-${{ matrix.platform }} | |
ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-${{ matrix.platform }} | |
build-args: | | |
BASE=${{ matrix.pg_major }}-bookworm | |
VCHORDBM25=${{ needs.versions.outputs.VCHORDBM25 }} | |
PGTOKENIZER=${{ needs.versions.outputs.PGTOKENIZER }} | |
VCHORD=${{ needs.versions.outputs.VCHORD }} | |
PGVECTOR=${{ needs.versions.outputs.PGVECTOR }} | |
create-manifests: | |
runs-on: ubuntu-latest | |
needs: ["versions", "docker"] | |
strategy: | |
matrix: | |
pg_major: ["14", "15", "16", "17", "18"] | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create manifest and push | |
run: | | |
docker manifest create \ | |
tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }} \ | |
--amend tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-amd64 \ | |
--amend tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-arm64 | |
docker manifest push tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }} | |
docker manifest create \ | |
ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }} \ | |
--amend ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-amd64 \ | |
--amend ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-arm64 | |
docker manifest push ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }} | |
create-latest-tags: | |
runs-on: ubuntu-latest | |
needs: ["versions", "create-manifests"] | |
strategy: | |
matrix: | |
pg_major: ["14", "15", "16", "17", "18"] | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push latest version-specific tags | |
run: | | |
# Tag each PostgreSQL version with a 'latest' tag for that version | |
docker manifest create \ | |
tensorchord/vchord-suite:pg${{ matrix.pg_major }}-latest \ | |
--amend tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-amd64 \ | |
--amend tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-arm64 | |
docker manifest push tensorchord/vchord-suite:pg${{ matrix.pg_major }}-latest | |
docker manifest create \ | |
ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-latest \ | |
--amend ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-amd64 \ | |
--amend ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-${{ needs.versions.outputs.DATE_TAG }}-arm64 | |
docker manifest push ghcr.io/tensorchord/vchord-suite:pg${{ matrix.pg_major }}-latest |