-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: push docker image also to Github registry
- Loading branch information
1 parent
c6da939
commit bd844df
Showing
1 changed file
with
23 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ env: | |
|
||
permissions: | ||
contents: write | ||
packages: write | ||
pull-requests: read | ||
|
||
jobs: | ||
|
@@ -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/[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 }} |