ETH canopy height → aerodynamic roughness, and as the DSM bare-earth object height #3068
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Documentation | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| paths: &paths | |
| - ".github/workflows/docs.yml" | |
| - "docs/**" | |
| - "examples/**" | |
| - "ext/**" | |
| - "src/**" | |
| - "Project.toml" | |
| push: | |
| paths: *paths | |
| branches: | |
| - main | |
| tags: '*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| JULIA_NUM_PRECOMPILE_TASKS: 8 | |
| JULIA_NUM_THREADS: 8 | |
| JULIA_DEPOT_PATH: "/storage5/github-action-runners/julia-depot" | |
| NUMERICAL_EARTH_LABEL_BUILD_ALL_EXAMPLES: 'build all examples' | |
| CDSAPI_URL: "https://cds.climate.copernicus.eu/api" | |
| CDSAPI_KEY: ${{ secrets.CDSAPI_KEY }} | |
| COPERNICUSMARINE_SERVICE_USERNAME: ${{ secrets.COPERNICUSMARINE_SERVICE_USERNAME }} | |
| COPERNICUSMARINE_SERVICE_PASSWORD: ${{ secrets.COPERNICUSMARINE_SERVICE_PASSWORD }} | |
| ECCO_USERNAME: ${{ secrets.ECCO_USERNAME }} | |
| ECCO_WEBDAV_PASSWORD: ${{ secrets.ECCO_WEBDAV_PASSWORD }} | |
| JULIA_CUDA_USE_COMPAT: false | |
| jobs: | |
| build-docs: | |
| name: Build documentation | |
| runs-on: [self-hosted, tartarus, gpu-3] | |
| timeout-minutes: 1440 | |
| permissions: | |
| actions: write | |
| contents: write | |
| pull-requests: read | |
| statuses: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1.12.5' | |
| - name: Set NUMERICAL_EARTH_BUILD_ALL_EXAMPLES | |
| shell: bash | |
| run: | | |
| if [[ ('${{ github.event_name }}' == 'push' && ('${{ github.ref }}' == 'refs/heads/main' || '${{ github.ref }}' == refs/tags/v*)) || ('${{ github.event_name }}' == 'pull_request' && ${{ contains(github.event.pull_request.labels.*.name, env.NUMERICAL_EARTH_LABEL_BUILD_ALL_EXAMPLES) }} == true) ]]; then | |
| NUMERICAL_EARTH_BUILD_ALL_EXAMPLES=true | |
| else | |
| NUMERICAL_EARTH_BUILD_ALL_EXAMPLES=false | |
| fi | |
| echo "NUMERICAL_EARTH_BUILD_ALL_EXAMPLES=${NUMERICAL_EARTH_BUILD_ALL_EXAMPLES}" | tee "${GITHUB_ENV}" | |
| - name: Instantiate and precompile | |
| shell: julia --project --color=yes {0} | |
| run: | | |
| using Pkg | |
| Pkg.instantiate(verbose=true) | |
| Pkg.precompile(strict=true) | |
| using CUDA | |
| CUDA.precompile_runtime() | |
| - name: Instantiate docs folder | |
| run: julia --project=docs --color=yes -e 'using Pkg; Pkg.instantiate(verbose=true)' | |
| - name: Install Veros in docs CondaPkg environment | |
| run: | | |
| julia --project=docs --color=yes -e ' | |
| using NumericalEarth, CondaPkg, PythonCall | |
| VerosModule = Base.get_extension(NumericalEarth, :NumericalEarthVerosExt) | |
| VerosModule.install_veros() | |
| ' | |
| - name: Build documentation | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| JULIA_DEBUG: Documenter | |
| JULIA_SSL_NO_VERIFY: "**" | |
| run: julia --project=docs --color=yes docs/make.jl | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: documentation-build | |
| path: docs/build | |
| retention-days: 10 | |
| deploy-docs: | |
| # We want to deploy docs if: | |
| # * it's a push, but only to main | |
| # * it's a PR, but not from a fork | |
| # * on a release | |
| needs: build-docs | |
| if: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))) || (github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork) }} | |
| permissions: | |
| actions: write | |
| contents: write | |
| pull-requests: read | |
| statuses: write | |
| runs-on: [self-hosted, tartarus] | |
| timeout-minutes: 30 | |
| concurrency: | |
| group: docs-pushing | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: julia-actions/setup-julia@v2 | |
| with: | |
| version: '1.12.5' | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| name: documentation-build | |
| path: docs/build | |
| - name: Remove extra files | |
| # There may be JLD2 files generated during execution of Literate | |
| # examples, we don't need them on the website. | |
| run: | |
| rm -fv docs/build/literated/*.jld2 | |
| - name: Deploy documentation | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DOCUMENTER_KEY: ${{ secrets.NUMERICALEARTHDOCUMENTATION_DOCUMENTER_KEY }} | |
| run: julia --color=yes docs/deploy.jl |