Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: push docker image also to Github registry #605

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ env:

permissions:
contents: write
packages: write
pull-requests: read

jobs:
Expand Down Expand Up @@ -144,46 +145,44 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Variables
id: variables
uses: actions/github-script@v7
- name: Generate docker image tags
id: metadata
uses: docker/metadata-action@v5
with:
script: |
if ("${{ matrix.rootless }}" == "true") {
core.setOutput('tags', "tensorchord/pgvecto-rs:pg${{ matrix.version }}-v${{ github.event.inputs.version }}-rootless");
} else {
core.setOutput('tags', "tensorchord/pgvecto-rs:pg${{ matrix.version }}-v${{ github.event.inputs.version }}");
}
flavor: |
# Disable latest tag
latest=false
images: |
name=ghcr.io/${{ github.repository }}
name=tensorchord/pgvecto-rs
tags: |
type=raw,value=pg${{ matrix.version }}-v${{ github.event.inputs.version }}-rootless,enable=${{ matrix.rootless }}
type=raw,value=pg${{ matrix.version }}-v${{ github.event.inputs.version }},enable=${{ !matrix.rootless }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
- name: Push postgres with pgvecto.rs to Docker Registry(rootful)
- name: Push postgres with pgvecto.rs to Docker Registry
if: matrix.rootless == false
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: "linux/amd64,linux/arm64"
file: ./docker/pgvecto-rs.Dockerfile
build-args: |
FROM_TAG=pg${{ matrix.version }}-v${{ github.event.inputs.version }}
POSTGRES_VERSION=${{ matrix.version }}
tags: ${{ steps.variables.outputs.tags }}
- name: Push postgres with pgvecto.rs to Docker Registry(rootless)
if: matrix.rootless == true
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: "linux/amd64,linux/arm64"
file: ./docker/pgvecto-rs-rootless.Dockerfile
file: ${{ matrix.rootless == 'true' && './docker/pgvecto-rs-rootless.Dockerfile' || './docker/pgvecto-rs.Dockerfile' }}
build-args: |
FROM_TAG=pg${{ matrix.version }}-v${{ github.event.inputs.version }}
POSTGRES_VERSION=${{ matrix.version }}
tags: ${{ steps.variables.outputs.tags }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
Loading