run pipelines and deploy wallet monitoring #16
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: run pipelines and deploy wallet monitoring | |
on: | |
schedule: | |
- cron: '0 2 * * *' # daily at 2am UTC | |
workflow_dispatch: # keep for manual runs | |
env: | |
DESTINATION__MOTHERDUCK__CREDENTIALS__DATABASE: ${{ secrets.DESTINATION__MOTHERDUCK__CREDENTIALS__DATABASE }} | |
DESTINATION__MOTHERDUCK__CREDENTIALS__PASSWORD: ${{ secrets.DESTINATION__MOTHERDUCK__CREDENTIALS__PASSWORD }} | |
SOURCES__DUNE__API_KEY: ${{ secrets.SOURCES__DUNE__API_KEY }} | |
SOURCES__DEBANK__ACCESS_KEY: ${{ secrets.SOURCES__DEBANK__ACCESS_KEY }} | |
EVIDENCE_SOURCE__md_wallets__database: ${{ secrets.EVIDENCE_SOURCE__MD_WALLETS__DATABASE }} | |
EVIDENCE_SOURCE__md_wallets__token: ${{ secrets.EVIDENCE_SOURCE__MD_WALLETS__TOKEN }} | |
jobs: | |
run-pipelines: | |
runs-on: ubuntu-22.04 | |
#outputs: | |
# wallet_db_path: ${{ steps.store-wallet-db.outputs.wallet_db_path }} | |
steps: | |
- name: check out | |
uses: actions/checkout@v4 | |
- name: set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.11' | |
- name: install poetry and run pipelines | |
run: | | |
pip install poetry | |
poetry install | |
cd pipelines && poetry run python main.py | |
#- name: store wallets db for deployment | |
# id: store-wallet-db | |
# run: echo "wallet_db_path=$GITHUB_WORKSPACE/data/wallets.duckdb" >> $GITHUB_OUTPUT | |
deploy-wallet-monitoring: | |
needs: run-pipelines | |
runs-on: ubuntu-22.04 | |
permissions: | |
pages: write | |
id-token: write | |
#env: | |
# wallet_db_path: ${{ needs.run-pipelines.outputs.wallet_db_path }} | |
steps: | |
- name: check out | |
uses: actions/checkout@v4 | |
- name: install node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: install dependencies | |
run: cd ./monitor && npm install | |
#- name: copy updated wallets db | |
# run: | | |
# echo "Copying wallet_db_path: ${{ env.wallet_db_path }}" | |
# cp -f ${{ env.wallet_db_path }} ./monitor/sources/wallets/wallets.duckdb | |
- name: build | |
env: | |
BASE_PATH: '/${{ github.event.repository.name }}' | |
run: | | |
cd ./monitor | |
npm run sources | |
npm run build | |
- name: upload artifacts | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'monitor/build/${{ github.event.repository.name }}' | |
- name: deploy | |
uses: actions/deploy-pages@v4 |