Skip to content

Commit

Permalink
Publish separate GCBM build under flint.gcbm (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
aornugent authored May 20, 2022
1 parent ffbc0d9 commit 1c8fbe2
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
41 changes: 40 additions & 1 deletion .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -89,3 +89,42 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

publish-gcbm-image:
name: Build FLINT
needs: publish-base-image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

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

- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/moja-global/flint.gbcm

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: ./docker
file: "./docker/Dockerfile.gcbm"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
34 changes: 34 additions & 0 deletions docker/Dockerfile.gcbm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM ghcr.io/moja-global/flint.core:master

WORKDIR $ROOTDIR/src

# moja.canada requires libpqxx.
RUN git clone --recursive https://github.com/jtv/libpqxx.git \
&& mkdir libpqxx/build \
&& cd libpqxx/build \
&& cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DSKIP_BUILD_TEST=ON \
-FSKIP_PQXX_STATIC=ON .. \
-DCMAKE_CXX_FLAGS=-fPIC \
-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql \
&& make --quiet -j $NUM_CPU install/strip \
&& make clean \
&& cd $ROOTDIR/src

# moja.canada
RUN git clone -b develop https://github.com/moja-global/moja.canada \
&& mkdir -p moja.canada/Source/build \
&& cd moja.canada/Source/build \
&& cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=$ROOTDIR \
-DENABLE_TESTS:BOOL=OFF \
-DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql .. \
&& make --quiet -s -j $NUM_CPU \
&& make --quiet install \
&& make clean \
&& cd $ROOTDIR/src

RUN mkdir -p /opt/gcbm
RUN ln -t /opt/gcbm /usr/local/lib/lib*
RUN ln -t /opt/gcbm /usr/local/bin/moja.cli
2 changes: 1 addition & 1 deletion local/rest_api_gcbm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/moja-global/moja.canada:develop
FROM ghcr.io/moja-global/flint.gcbm:master

WORKDIR /app

Expand Down

0 comments on commit 1c8fbe2

Please sign in to comment.