zone-competences-geojson/.forgejo/workflows/main.yml

51 lines
1.9 KiB
YAML
Raw Normal View History

2024-07-06 14:04:18 +00:00
name: Cache OSM data
on:
schedule:
- cron: '@daily'
push:
branches:
- main
jobs:
cache:
runs-on: docker
steps:
- name: Download OSM data
run: |
2024-07-06 16:17:02 +00:00
curl -L -o osm.pbf \
2024-07-06 14:04:18 +00:00
--fail \
https://download.geofabrik.de/europe/france-latest.osm.pbf
2024-07-06 16:17:02 +00:00
- name: Download institutions data
2024-07-06 14:04:18 +00:00
run: |
2024-07-06 16:17:02 +00:00
curl -L -o competences-territoriales.csv \
2024-07-06 14:04:18 +00:00
--fail \
https://www.data.gouv.fr/fr/datasets/r/c53cd4d4-4623-4772-9b8c-bc72a9cdf4c2
- name: Run action
uses: aeris/zone-competences-geojson@main
with:
osm_file: osm.pbf
data_file: competences-territoriales.csv
output_file: competences-territoriales.geojson
- name: Upload as artifact
uses: actions/upload-artifact@v4
2024-07-06 14:04:18 +00:00
with:
name: competences-territoriales
path: competences-territoriales.geojson
2024-07-06 14:04:18 +00:00
- name: Upload to Forgejo Package Registry
run: |
curl --user ${{ secrets.USERNAME }}:${{ secrets.PAT }} \
--upload-file competences-territoriales.geojson \
--fail \
https://forgejo.almanach.altearn.xyz/api/packages/aeris/generic/competences-territoriales-police-france/$(date +%Y-%m-%d)/competences-territoriales.geojson && \
curl --user ${{ secrets.USERNAME }}:${{ secrets.PAT }} \
--request DELETE \
https://forgejo.almanach.altearn.xyz/api/packages/aeris/generic/competences-territoriales-police-france/latest/competences-territoriales.geojson && \
curl --user ${{ secrets.USERNAME }}:${{ secrets.PAT }} \
--upload-file competences-territoriales.geojson \
--fail \
https://forgejo.almanach.altearn.xyz/api/packages/aeris/generic/competences-territoriales-police-france/latest/competences-territoriales.geojson