diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..905fe14 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +Dockerfile +.* +dist-newstyle diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 171dc11..dd658ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,3 +26,5 @@ jobs: with: push: ${{ github.ref == 'refs/heads/main'}} tags: ghcr.io/geniusyield/smart-order-router:latest + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/Dockerfile b/Dockerfile index ebb9e17..829eb91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,9 +43,17 @@ ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" # ==================================[ BUILD ]======================================== WORKDIR /SOR -COPY . . +RUN cabal update +COPY cabal.project ./ +COPY geniusyield-orderbot.cabal ./ +COPY geniusyield-dex-api/geniusyield-dex-api.cabal ./geniusyield-dex-api/ +COPY geniusyield-orderbot-framework/geniusyield-orderbot-framework.cabal geniusyield-orderbot-framework/ RUN cabal update +RUN cabal build geniusyield-dex-api --only-dependencies + +COPY . . + RUN cabal build all RUN cabal test RUN cabal install --global