Update datawarehouse datasets #164
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: Update datawarehouse datasets | |
on: | |
schedule: | |
- cron: "42 0 * * *" | |
workflow_dispatch: | |
jobs: | |
update_dw: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dao-scripts | |
run: pip install dao-scripts | |
- name: Get cached datawarehouse | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: update-datasets.yml | |
name: datawarehouse | |
path: ./datawarehouse/ | |
if_no_artifact_found: warn | |
- name: Obtain datawarehouse | |
run: dao-scripts --skip-token-balances | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: datawarehouse | |
path: ./datawarehouse/ | |
upload_dw: | |
runs-on: ubuntu-latest | |
environment: daviddavo | |
needs: [update_dw] | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: datawarehouse | |
path: ./datawarehouse/ | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dao-scripts | |
run: pip install 'dao-scripts[upload]>=1.1.14' | |
- name: Patch Zenodo client (provisional) | |
run: | | |
find . -wholename '*/zenodo_client/api.py' -exec sed -i 's/_prepare_new_version(new_deposition_data\\["metadata"\\]\\["version"\\])/_prepare_new_version(new_deposition_data["metadata"].get("version", ""))/g' {} + | |
- name: Upload dataset | |
run: dao-utils-upload-dw | |
env: | |
KAGGLE_USERNAME: ${{ secrets.KAGGLE_USERNAME }} | |
KAGGLE_KEY: ${{ secrets.KAGGLE_KEY }} | |
ZENODO_DEPOSITION_ID: ${{ secrets.ZENODO_DEPOSITION_ID }} | |
ZENODO_API_TOKEN: ${{ secrets.ZENODO_API_TOKEN }} |