-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (61 loc) · 2.14 KB
/
deploy.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
name: substrate-etl Report Generation
on:
push:
branches:
- main
paths:
- .github/workflows/deploy.yml
- reporter.js
- generateNetworksSummary
schedule:
- cron: '0 */2 * * *'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [17.x]
steps:
- uses: actions/checkout@v2
- name: Use node js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: substrate-etl Report Generation
run: node generateNetworksSummary
- name: Configure Git Client
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Set timestamp
run: |
echo "CURRENT_TIMESTAMP=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV
- name: Commit changes to substrate-etl
run: |
git add --all SUMMARY.md kusama/* polkadot/* && \
git commit -m "[Auto] Substrate-etl Summary (${{ env.CURRENT_TIMESTAMP }})" || echo "No changes to commit"
- name: Push changes to substrate-etl
run: git push origin $BRANCH_NAME
- name: send Notification to telegram
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
message: |
${{ github.actor }} created commit:
Commit message: ${{ github.event.commits[0].message }}
Repository: ${{ github.repository }}
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# with:
# to: ${{ secrets.TELEGRAM_TO }}
# token: ${{ secrets.TELEGRAM_TOKEN }}
# message: |
# ${{ github.actor }} created commit:
# Commit message: ${{ github.event.commits[0].message }}
# Repository: ${{ github.repository }}
# See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}