Skip to content

Commit 70b12f8

Browse files
committed
fix(ci): use webui CID as cache key
1 parent 8429946 commit 70b12f8

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

.github/workflows/ci.yml

+24-9
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,22 @@ jobs:
1919
with:
2020
node-version: 'lts/*'
2121

22+
- name: Read ipfs-webui CID from package.json
23+
id: read-webui-version
24+
run: |
25+
echo '::echo::on'
26+
echo "::set-output name=cid::$(grep "build:webui:download" package.json | grep -Eio "bafy[a-z0-9]+")"
27+
echo '::echo::off'
28+
shell: bash
2229
- name: Cache webui
23-
uses: actions/cache@v2
30+
uses: actions/cache@v3
2431
id: webui-cache
2532
with:
2633
path: assets/webui
27-
key: ${{ hashFiles('package.json') }} # webui CID is defined in this file
34+
key: ${{ steps.read-webui-version.cid }}
2835

2936
- name: Cache bigger downloads
30-
uses: actions/cache@v2
37+
uses: actions/cache@v3
3138
id: cache
3239
if: steps.webui-cache.outputs.cache-hit != 'true'
3340
with:
@@ -75,15 +82,19 @@ jobs:
7582
with:
7683
node-version: 'lts/*'
7784

85+
- name: Read ipfs-webui CID from package.json
86+
id: read-webui-version
87+
run: echo "::set-output name=cid::$(grep "build:webui:download" package.json | grep -Eio "bafy[a-z0-9]+")"
88+
shell: bash
7889
- name: Cache webui
79-
uses: actions/cache@v2
90+
uses: actions/cache@v3
8091
id: webui-cache
8192
with:
8293
path: assets/webui
83-
key: ${{ hashFiles('package.json') }}
94+
key: ${{ steps.read-webui-version.cid }}
8495

8596
- name: Cache bigger downloads
86-
uses: actions/cache@v2
97+
uses: actions/cache@v3
8798
id: cache
8899
with:
89100
path: ${{ github.workspace }}/.cache
@@ -138,15 +149,19 @@ jobs:
138149
with:
139150
node-version: 'lts/*'
140151

152+
- name: Read ipfs-webui CID from package.json
153+
id: read-webui-version
154+
run: echo "::set-output name=cid::$(grep "build:webui:download" package.json | grep -Eio "bafy[a-z0-9]+")"
155+
shell: bash
141156
- name: Cache webui
142-
uses: actions/cache@v2
157+
uses: actions/cache@v3
143158
id: webui-cache
144159
with:
145160
path: assets/webui
146-
key: ${{ hashFiles('package.json') }}
161+
key: ${{ steps.read-webui-version.cid }}
147162

148163
- name: Cache bigger downloads
149-
uses: actions/cache@v2
164+
uses: actions/cache@v3
150165
id: cache
151166
with:
152167
path: ${{ github.workspace }}/.cache

0 commit comments

Comments
 (0)