-
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (52 loc) · 1.59 KB
/
plot.yaml
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
name: Update plots
on:
schedule:
- cron: "42 0 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
plots:
name: PPoS Dex Plots
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.3
- name: Set up Poetry
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.6.1
- name: Install Python dependencies
run: poetry install
- name: Checkout local images branch
run: git checkout -b images
- name: Save timeseries
run: poetry run python3 ppos_dex.py timeseries --save
- name: Save snapshots
run: poetry run python3 ppos_dex.py snapshot --save
- name: Delete remote images branch
run: git push origin -d images
continue-on-error: true
- name: Commit files
id: commit_files
if: always()
run: |
git config --local user.email "cosimo.bassi@gmail.com"
git config --local user.name "github-actions[bot]"
if [ -n "$(git status --porcelain)" ]; then
git commit -m "refreshed images 🤖" -a
echo "HAS_COMMITS=true" >> "$GITHUB_ENV"
else
echo "no changes - skipping "
echo "HAS_COMMITS=false" >> "$GITHUB_ENV"
fi
- name: Push changes
uses: ad-m/github-push-action@master
if: env.HAS_COMMITS != false
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: images