Skip to content

Commit

Permalink
Shared image for CI and local dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rouge8 committed Dec 19, 2023
1 parent b15f842 commit fbf4735
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to the container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
run: |
docker build --build-arg="POSTGRES_VERSION=${POSTGRES_VERSION}" --build-arg="PGVECTOR_VERSION=${PGVECTOR_VERSION}" --tag "ghcr.io/zapgram/cimg-postgres-pgvector:${POSTGRES_VERSION}-${PGVECTOR_VERSION}" .
- name: Publish image
if: github.ref_name == 'trunk'
run: |
docker push "ghcr.io/zapgram/cimg-postgres-pgvector:${POSTGRES_VERSION}-${PGVECTOR_VERSION}"
- name: Build and (maybe) publish image
uses: docker/build-push-action@v5
with:
context: .
build-args: |
POSTGRES_VERSION=${{env.POSTGRES_VERSION}}
PGVECTOR_VERSION=${{env.PGVECTOR_VERSION}}
platforms: linux/amd64,linux/arm64
tags: ghcr.io/zapgram/pilot-postgres:${{env.POSTGRES_VERSION}}-pgvector${{env.PGVECTOR_VERSION}}
push: ${{ github.ref_name == 'trunk' }}
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
ARG POSTGRES_VERSION

FROM cimg/postgres:${POSTGRES_VERSION}
FROM postgres:${POSTGRES_VERSION}

RUN apt-get update \
&& apt-get install -y git make gcc postgresql-server-dev-15 \
&& rm -rf /var/lib/apt/lists/*

ARG PGVECTOR_VERSION

Expand Down

0 comments on commit fbf4735

Please sign in to comment.