Scheduled build #26486
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |