From e2ccee4f1abc71acd9eabfec265ba58ff4d69c8d Mon Sep 17 00:00:00 2001 From: baloola Date: Thu, 29 Jun 2023 18:43:51 +0200 Subject: [PATCH] add links paths + workflow fixes --- .github/workflows/pages.yml | 3 ++- stac/stac-generator/requirements.txt | 4 +++- stac/stac-generator/stac-generator.py | 11 ++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f492053e..82e7a943 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -43,11 +43,12 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | python3 ./stac/stac-generator/stac-generator.py + stac copy -t ABSOLUTE_PUBLISHED --publish-location "https://fairicube.github.io/data-requests" stac_dist/catalog.json out - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: # Upload entire repository - path: './stac/' + path: './out' - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 diff --git a/stac/stac-generator/requirements.txt b/stac/stac-generator/requirements.txt index 951ffa1e..ae6c237e 100644 --- a/stac/stac-generator/requirements.txt +++ b/stac/stac-generator/requirements.txt @@ -1,3 +1,5 @@ pystac gql -shapely \ No newline at end of file +shapely +stactools +requests-toolbelt \ No newline at end of file diff --git a/stac/stac-generator/stac-generator.py b/stac/stac-generator/stac-generator.py index 9161ee75..9dd41dba 100644 --- a/stac/stac-generator/stac-generator.py +++ b/stac/stac-generator/stac-generator.py @@ -186,7 +186,12 @@ def insert_value(field, value_list, listed_fields, doc): issues = client.execute(query_1)[ "organization"]["repository"]["issues"]["edges"] -index_catalog = pystac.Catalog.from_file(os.path.join('./stac', 'index.json')) +index_catalog = pystac.Catalog( + id="index", + title="data-access catalog", + description="The stac catalog that contains all the generated datacube items." +) + for index, issue in enumerate(issues): title = issue["node"]["title"].split("]: ")[-1].replace(" ", "_") issue_type = re.findall(r'\[(.*?)\]', issue["node"]["title"]) @@ -245,5 +250,5 @@ def insert_value(field, value_list, listed_fields, doc): index_catalog.add_item(stac_item) index_catalog.normalize_and_save( - root_href="https://fairicube.github.io/data-requests/stac/", - catalog_type=pystac.CatalogType.ABSOLUTE_PUBLISHED) + root_href="stac_dist/", + catalog_type=pystac.CatalogType.SELF_CONTAINED)