From f3f70e97329ade8ac4ab9cbafe74dd95e7970a24 Mon Sep 17 00:00:00 2001 From: 4TT1L4 <2914096+4TT1L4@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:02:15 +0200 Subject: [PATCH 1/2] 30-ci-first-build-dependencies-only --- .dockerignore | 3 +++ Dockerfile | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .dockerignore 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/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 From 9d0024507fa2bd15195c6cf6d6b15a1ac2d79b7b Mon Sep 17 00:00:00 2001 From: 4TT1L4 <2914096+4TT1L4@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:03:40 +0200 Subject: [PATCH 2/2] [CI] Docker layer caching#32 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) 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