diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..0068a8c --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,52 @@ +name: Build and Publish Docs + +on: + push: + branches: + - main + paths: + - 'geospatial-studio-sdk/docs/**' + - '.github/workflows/publish-docs.yml' + pull_request: + branches: + - main + paths: + - 'geospatial-studio-sdk/docs/**' + - '.github/workflows/publish-docs.yml' + types: [opened, synchronize, reopened] + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install poetry + run: pip install poetry + + - name: Install dependencies + working-directory: ./geospatial-studio-sdk + run: poetry install + + - name: Build documentation + working-directory: ./geospatial-studio-sdk + run: poetry run docs-build + + - name: Deploy to GitHub Pages + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./geospatial-studio-sdk/sdk-docs-site + publish_branch: gh-pages + cname: terrastackai.github.io diff --git a/.gitignore b/.gitignore index e0185e0..4d341ae 100644 --- a/.gitignore +++ b/.gitignore @@ -176,3 +176,4 @@ resources.qrc *.geostudio_apikey* tasks/ *.geostudio_config_file* +geospatial-studio-sdk/docs/examples/