From ccaef348f3f48730bb389ced37e3d3245ff924ae Mon Sep 17 00:00:00 2001 From: Daniel Santillan Date: Tue, 16 Apr 2024 11:08:08 +0200 Subject: [PATCH] Initial commit --- .github/workflows/build_main.yaml | 44 +++++++++++++++++++++++++++++ .gitignore | 1 + LICENSE | 21 ++++++++++++++ README.md | 21 ++++++++++++++ catalogs/template_catalog.yaml | 9 ++++++ collections/example_collection.yaml | 23 +++++++++++++++ layers/baselayers.yaml | 7 +++++ layers/overlays.yaml | 7 +++++ 8 files changed, 133 insertions(+) create mode 100644 .github/workflows/build_main.yaml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 catalogs/template_catalog.yaml create mode 100644 collections/example_collection.yaml create mode 100644 layers/baselayers.yaml create mode 100644 layers/overlays.yaml diff --git a/.github/workflows/build_main.yaml b/.github/workflows/build_main.yaml new file mode 100644 index 0000000..d86d899 --- /dev/null +++ b/.github/workflows/build_main.yaml @@ -0,0 +1,44 @@ +# This is a basic workflow takes care of building and deploying +# catalog when pushing to main branch + +# Simple workflow for deploying static content to GitHub Pages +name: Deploy static content to Pages + +on: + # Triggers the workflow on push or pull request events but only for the "main" branch + push: + branches: [ "main" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-22.04 + permissions: + contents: write + pages: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install dependencies + run: | + pip install -U pip + pip install eodash_catalog + - name: Build + env: + SH_INSTANCE_ID: ${{ secrets.SH_INSTANCE_ID }} + SH_CLIENT_ID: ${{ secrets.SH_CLIENT_ID }} + SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }} + run: eodash_catalog + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/main' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build + force_orphan: true + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d163863 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c952950 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 eodash + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..26d5cdc --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# catalog-template +Template for creating eodash catalog repository + +## How-to +You can create a new repository using the "use this template" button. +This will set-up a catalog repository for you with example configuration files as well as a github workflow that will automatically build and deploy the STAC catalog to the gh-page branch. +For every commit you push to the main branch the catalog will be regenerated and deployed there. + +Please consider! This deployment strategy is intended for reasonable sized catalogs, if a catalog gets larger a more robust strategy should be implemented, changing the current github action, for example deploying the build to an s3 bucket. + +To make the build catalog available through github pages, please go to: + * repository settings + - Pages (left side panel) + - Source: "Deploy from branch" (should be selected) + - Branch: Select "gh-pages" from dropdown + - (leave root selected) + - Click on save + +Once enabled you can navigate to the catalog using: + +https://\.github.io/\/\/catalog.json diff --git a/catalogs/template_catalog.yaml b/catalogs/template_catalog.yaml new file mode 100644 index 0000000..b28c973 --- /dev/null +++ b/catalogs/template_catalog.yaml @@ -0,0 +1,9 @@ +id: "template_catalog" +title: "Template Catalog" +description: "This catalog definition is part of the eodash catalog template, please update to fit your needs" +endpoint: "https://organization.github.io/repository/repository/" +default_base_layers: "layers/baselayers" +default_overlay_layers: "layers/overlays" +assets_endpoint: "https://raw.githubusercontent.com/organization/assets-repo/main/" +collections: + - example_collection diff --git a/collections/example_collection.yaml b/collections/example_collection.yaml new file mode 100644 index 0000000..92226f9 --- /dev/null +++ b/collections/example_collection.yaml @@ -0,0 +1,23 @@ +Name: example_collection +Title: Example Collection +EodashIdentifier: EX1 +Description: This can be **markdown** or a reference to a markdown file +Themes: + - example +Tags: + - example tag +DataSource: + Spaceborne: + Satellite: + - Satellitename + Sensor: + - Sensorname + InSitu: + - Other insitu data +Agency: + - Example agency +Resources: + - EndPoint: https://tiles.maps.eox.at/wms? + Name: WMS + LayerId: terrain-light_3857 + MediaType: image/png diff --git a/layers/baselayers.yaml b/layers/baselayers.yaml new file mode 100644 index 0000000..532d963 --- /dev/null +++ b/layers/baselayers.yaml @@ -0,0 +1,7 @@ +- id: cloudless-2021 + name: EOxCloudless 2021 + url: '//s2maps-tiles.eu/wmts/1.0.0/s2cloudless-2021_3857/default/g/{z}/{y}/{x}.jpeg' + media_type: image/jpeg + attribution: '{ EOxCloudless 2021: Sentinel-2 cloudless - s2maps.eu by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2021) }' + maxNativeZoom: 17 + protocol: 'xyz' \ No newline at end of file diff --git a/layers/overlays.yaml b/layers/overlays.yaml new file mode 100644 index 0000000..284d542 --- /dev/null +++ b/layers/overlays.yaml @@ -0,0 +1,7 @@ +- id: overlay_bright + name: 'Overlay labels' + url: '//s2maps-tiles.eu/wmts/1.0.0/overlay_base_bright_3857/default/g/{z}/{y}/{x}.png' + attribution: '{ Overlay: Data © OpenStreetMap contributors, Made with Natural Earth, Rendering © EOX }' + visible: true + maxNativeZoom: 14 + protocol: 'xyz' \ No newline at end of file