forked from aave/interface
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.77 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
name: Update build cache
# This action checks if there's new proposal data every 12h
# If new proposal data is found the cache will be warmed up & a new build will be generated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: 0 */3 * * *
jobs:
cache-refresh:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
with:
token: ${{ secrets.BOT_TOKEN }}
- name: Update cache
uses: ./.github/actions/build
with:
YARN_COMMAND: 'cache:update'
- name: check diff
run: |
if [[ -z $(git status -s) ]]
then
echo "tree is clean"
else
git config --global user.name 'Cache bot'
git config --global user.email '[email protected]'
git commit -am "chore: automated cache update [skip cypress]"
git push
exit
fi
NotifyFailure:
needs: [cache-refresh]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- id: text
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "out=${{ github.workflow }}:\t<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>\\n $(gh api /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs | jq -c '.jobs | .[] | select( .conclusion | contains("failure"))' | jq -r '"- <\(.html_url)|\(.name)>\\n"' | tr '\n' ' ')" >> $GITHUB_OUTPUT
- name: Webhook
uses: joelwmale/webhook-action@master
with:
url: ${{ secrets.WEBHOOK_URL }}
body: '{"text": "${{ steps.text.outputs.out }}"}'