Skip to content

Commit 2eb7321

Browse files
authored
Merge pull request #406 from BinderDavid/change-deploy-actions
Update the caching logic for the deploy action.
2 parents b6da9b5 + 5513c40 commit 2eb7321

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,39 @@ jobs:
1414
strategy:
1515
matrix:
1616
target: [haskellorg, githubpages]
17+
ghc: ["9.2.5"]
18+
cabal: ["3.10.1"]
1719

1820
steps:
19-
- name: Install GHC 9.2.5
20-
run: ghcup install ghc 9.2.5
21-
22-
- name: Select GHC 9.2.5
23-
run: ghcup set ghc 9.2.5
24-
2521
- name: Check out repo
2622
uses: actions/checkout@v3
23+
24+
- name: Install Haskell Toolchain
25+
uses: haskell/actions/setup@v2
26+
with:
27+
ghc-version: ${{ matrix.ghc }}
28+
cabal-version: ${{ matrix.cabal }}
29+
30+
- name: Configure the build plan
31+
working-directory: message-index
32+
run: |
33+
cabal update
34+
cabal build --dry-run
35+
# cabal build --dry-run creates dist-newstyle/cache/plan.json
36+
# Keep a watch on this `cabal-3.9 build --dry-run` bug:
37+
# https://github.com/haskell/cabal/issues/8706
2738

2839
- name: Read the Cabal cache
2940
uses: actions/cache@v3
3041
with:
3142
path: |
3243
~/.cabal/store
3344
message-index/dist-newstyle
34-
key: cabal-cache-0-${{ hashFiles('message-index/message-index.cabal') }}
45+
key: |
46+
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-${{ hashFiles('**/plan.json') }}
3547
restore-keys: |
36-
cabal-cache-0
48+
cabal-cache-ghc-${{ matrix.ghc }}-cabal-${{ matrix.cabal }}-
3749
38-
- name: Update the Cabal index
39-
run: cabal update
4050
4151
- name: Build with Hakyll
4252
working-directory: message-index

0 commit comments

Comments
 (0)