download.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: download
  2. on:
  3. workflow_dispatch:
  4. jobs:
  5. download:
  6. runs-on: ubuntu-22.04
  7. steps:
  8. - name: set download date
  9. run: echo "DOWNLOAD_DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
  10. - name: install datalad
  11. uses: awalsh128/cache-apt-pkgs-action@v1.4.2
  12. with:
  13. packages: datalad
  14. version: 1.0
  15. - name: install ssh key for gin.hemio.de access
  16. uses: shimataro/ssh-key-action@v2
  17. with:
  18. key: ${{ secrets.GIN_HEMIO_SSH_KEY }}
  19. name: id_ginhemio # optional
  20. known_hosts: |
  21. gin.hemio.de ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPA+r/S2vn2JmN9z62e/vla/pDgaEfFUmghlOP7idyP9
  22. config: |
  23. Host gin.hemio.de
  24. User git
  25. IdentityFile ~/.ssh/id_ginhemio
  26. IdentitiesOnly yes
  27. - name: configure git user
  28. run: git config --global user.email "mika.pflueger@climate-resource.com"
  29. - name: configure git email
  30. run: git config --global user.name "Mika Pflüger (via github actions)"
  31. - name: clone repo
  32. run: datalad clone https://github.com/mikapfl/unfccc_di_data.git
  33. - name: configure push access to gin.hemio.de
  34. run: |
  35. cd unfccc_di_data/
  36. datalad siblings add -s ginhemio --url https://gin.hemio.de/CR/unfcc_di_data --pushurl gin.hemio.de:/CR/unfcc_di_data
  37. git config remote.ginhemio.annex-ignore false
  38. - name: setup Python
  39. uses: actions/setup-python@v5
  40. with:
  41. python-version: '3.11'
  42. - name: install requirements
  43. run: pip install -r unfccc_di_data/requirements.txt
  44. - name: download data
  45. run: datalad -C unfccc_di_data/ rerun download
  46. - name: publish newly downloaded data
  47. run: |
  48. cd unfccc_di_data/
  49. datalad siblings
  50. datalad push --to ginhemio --data anything