-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (48 loc) · 1.53 KB
/
pages-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
name: "Scheduled build"
on:
push:
branches:
- main
schedule:
# per github recommendation to not run things at the top of each hour... or something
- cron: '47 * * * *'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
steps:
- name: Checkout main 🛎️
uses: actions/[email protected]
with:
ref: main
- name: Checkout snapshots 🛎️
uses: actions/[email protected]
with:
ref: snapshots
path: snapshots
- name: Install and Build 🔧
env:
WEB3_INFURA_PROJECT_ID: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }}
run: |
pip3 install -r requirements.txt
python3 script.py
# public folder will only exist if new snapshot was made
- name: Commit snapshots
if: hashFiles('public') != ''
uses: EndBug/add-and-commit@v7
with:
cwd: snapshots
default_author: github_actions
branch: snapshots
message: 'hourly cronjob update, probably'
- name: Deploy 🚀
if: hashFiles('public') != ''
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: public # The folder the action should deploy.
git-config-name: 'github-actions'
git-config-email: '41898282+github-actions[bot]@users.noreply.github.com'