-
Notifications
You must be signed in to change notification settings - Fork 53
81 lines (69 loc) · 2.13 KB
/
op_stack_chain_revenue.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
73
74
75
76
77
78
79
80
81
name: OP Stack Chain Revenue Pulls
on:
schedule:
- cron: '57 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Display System Info
run: |
free -h
df -h
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.11'
- name: Cache pipenv dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-
- name: Install pipenv
run: |
python -m pip install pipenv
- name: Install Dependencies
run: |
pipenv install --dev
- name: Generate py files
working-directory: op_chains_tracking
run: |
pipenv run jupyter nbconvert --to python l2_revenue_tracking.ipynb
- name: Run File
working-directory: op_chains_tracking
run: |
pipenv run python l2_revenue_tracking.py
env:
IS_RUNNING_LOCAL: ${{ secrets.IS_RUNNING_LOCAL }}
BQ_APPLICATION_CREDENTIALS: ${{ secrets.BQ_APPLICATION_CREDENTIALS }}
BQ_PROJECT_ID: ${{ secrets.BQ_PROJECT_ID }}
- name: Pull changes
run: |
git pull origin main
- name: Commit files
id: commit
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions"
git add --all
if [ -z "$(git status --porcelain)" ]; then
echo "No changes to commit."
echo "push=false" >> $GITHUB_OUTPUT
else
git commit -m "GH Action Update - Chain Revenue" -a
echo "push=true" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Push changes
if: steps.commit.outputs.push == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}