Skip to content

postgres

postgres #14

Workflow file for this run

name: postgres
on:
workflow_dispatch:
env:
PG_MAJOR: "17"
REPOSITORY: tgdrive/${{ github.workflow }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Docker metadata
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REPOSITORY }}
labels: |
org.opencontainers.image.version=${{ env.PG_MAJOR}}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=${{ env.REPOSITORY }}
- name: PgVecto Version
id: pgvecto
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
apt update && apt install -y curl jq
LATEST_TAG=$(curl -sL \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
"https://api.github.com/repos/tensorchord/pgvecto.rs/releases/latest" | \
jq -r .tag_name)
echo "latest_tag=${LATEST_TAG}" >> $GITHUB_OUTPUT
- name: Build Image
uses: docker/build-push-action@v6
with:
context: ./postgres
push: true
platforms: linux/amd64,linux/arm64
build-args: |
PG_MAJOR
PGVECTO_TAG=${{ steps.pgvecto.outputs.latest_tag }}
labels: ${{ steps.docker_meta.outputs.labels }}
sbom: true
provenance: true
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
tags: |
ghcr.io/${{ env.REPOSITORY }}:${{ env.PG_MAJOR }}