download.yaml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: download
  2. on:
  3. pull_request:
  4. push:
  5. branches: [main]
  6. tags: ['v*']
  7. jobs:
  8. download:
  9. runs-on: ubuntu-22.04
  10. steps:
  11. - name: install datalad
  12. uses: awalsh128/cache-apt-pkgs-action@v1.4.2
  13. with:
  14. packages: datalad
  15. version: 1.0
  16. - name: Install poetry
  17. shell: bash
  18. run: |
  19. pipx install poetry
  20. which poetry
  21. poetry --version # Check poetry installation
  22. - name: configure git email
  23. run: git config --global user.email "daniel.busch@climate-resource.com"
  24. - name: configure git user
  25. run: git config --global user.name "Daniel Busch (via github actions)"
  26. - name: clone repo
  27. run: datalad clone https://github.com/primap-community/FAOSTAT_data_primap.git
  28. - name: setup Python
  29. uses: actions/setup-python@v5
  30. with:
  31. python-version: '3.11'
  32. # - name: install requirements
  33. # run: pip install -r FAOSTAT_data_primap/requirements.txt
  34. - name: update to latest data from gin.hemio.de
  35. run: |
  36. cd FAOSTAT_data_primap/
  37. datalad siblings add -s gin --url https://gin.hemio.de/crdanielbusch/FAOSTAT_data_primap
  38. git config remote.gin.annex-ignore false
  39. datalad update -s gin --how merge
  40. - name: Set Poetry environment
  41. shell: bash
  42. run: |
  43. cd FAOSTAT_data_primap/
  44. poetry config virtualenvs.create true
  45. poetry config virtualenvs.in-project true
  46. poetry install --no-interaction --all-extras --only 'main,dev'
  47. poetry run python --version # Check python version just in case
  48. - name: download data
  49. run: |
  50. cd FAOSTAT_data_primap/
  51. datalad unlock .
  52. datalad run -o downloaded_data poetry run python3 scripts/download_all_domains.py
  53. # run: datalad -C unfccc_di_data/ run -o data/annexI/*.csv.gz -o data/non-annexI/*.csv.gz -o data/all.parquet python download.py
  54. # - name: publish newly downloaded data
  55. # run: |
  56. # cd FAOSTAT_data_primap/
  57. # datalad update -s ginhemio --how merge
  58. # datalad push --to ginhemio --data anything