-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (66 loc) · 2.18 KB
/
update-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Update cache
# This action checks if there's new finished proposals every 3h
# If new finished proposal data is found the cache will be warmed up & push
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: 0 */3 * * *
jobs:
cache-updates:
strategy:
matrix:
# Only mainnet for now
network: [mainnet]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Packages install
shell: sh
run: yarn --frozen-lockfile --prefer-offline
- name: Update cache
shell: sh
run: yarn cache:update
env:
CORE_NETWORK: ${{ matrix.network }}
RPC_POLYGON: ${{ secrets.RPC_POLYGON }}
RPC_OPTIMISM: ${{ secrets.RPC_OPTIMISM }}
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
RPC_BASE: ${{ secrets.RPC_BASE }}
RPC_ARBITRUM: ${{ secrets.RPC_ARBITRUM }}
RPC_ZKEVM: ${{ secrets.RPC_ZKEVM }}
RPC_ZKSYNC: ${{ secrets.RPC_ZKSYNC }}
IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }}
- name: Parse cache to separate files
shell: sh
run: yarn cache:parse
env:
CORE_NETWORK: ${{ matrix.network }}
RPC_POLYGON: ${{ secrets.RPC_POLYGON }}
RPC_OPTIMISM: ${{ secrets.RPC_OPTIMISM }}
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
RPC_BASE: ${{ secrets.RPC_BASE }}
RPC_ARBITRUM: ${{ secrets.RPC_ARBITRUM }}
RPC_ZKEVM: ${{ secrets.RPC_ZKEVM }}
RPC_ZKSYNC: ${{ secrets.RPC_ZKSYNC }}
IPFS_GATEWAY: ${{ secrets.IPFS_GATEWAY }}
- name: Check code diff and push
run: |
if [[ -z $(git status -s) ]]
then
echo "tree is clean"
else
git config --global user.name 'Cache update'
git config --global user.email '[email protected]'
git pull
git add .
git commit -am "chore: automated cache update"
git push
exit
fi