Skip to content

Commit

Permalink
feat: push docker image also to Github registry
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored Oct 14, 2024
1 parent f7c766d commit d913c7a
Showing 1 changed file with 23 additions and 24 deletions.
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 @@ -147,46 +148,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/[email protected]
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 }}

0 comments on commit d913c7a

Please sign in to comment.