gcloud-lab/.github/workflows/build-pgvector-image.yml

46 lines
1.2 KiB
YAML

name: Build pgvector image
on:
workflow_dispatch:
env:
REGISTRY: gcr.io/devops-lab-cluster
IMAGE_NAME: postgres-pgvector
IMAGE_TAG: "15.2-0.8.0"
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Authenticate to GCR
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCLOUD_SERVICE_ACCOUNT_KEY }}
project_id: devops-lab-cluster
token_format: access_token
- name: Docker Login to GCR
uses: docker/login-action@v3
with:
registry: gcr.io
username: _oauth2
password: ${{ steps.auth.outputs.access_token }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push pgvector image
uses: docker/build-push-action@v5
with:
context: apps/base/customer1/hermes-db
file: apps/base/customer1/hermes-db/Dockerfile.postgres-pgvector
push: true
tags: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}"
cache-from: type=gha
cache-to: type=gha,mode=max