Merge pull request #22 from chiaweh2/develop #19
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: Build and Deploy Package Doc | |
| on: | |
| push: | |
| branches: | |
| - main # Trigger the workflow on pushes to the main branch | |
| jobs: | |
| docbuild: | |
| runs-on: ubuntu-latest | |
| # Environment required for GitHub Pages deployment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| steps: | |
| # Checkout the repository | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Install dependencies | |
| - name: Setup Micromamba | |
| uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| environment-file: environment.yml | |
| init-shell: bash | |
| # Install the package in development mode | |
| - name: Install package in development mode | |
| shell: bash -l {0} | |
| run: | | |
| micromamba activate map-binning | |
| pip install -e . | |
| # Build the package documentation | |
| - name: Build Jupyter Book | |
| shell: bash -l {0} | |
| env: | |
| COPERNICUSMARINE_SERVICE_USERNAME: ${{ secrets.COPERNICUSMARINE_SERVICE_USERNAME }} | |
| COPERNICUSMARINE_SERVICE_PASSWORD: ${{ secrets.COPERNICUSMARINE_SERVICE_PASSWORD }} | |
| run: | | |
| micromamba activate map-binning | |
| jupyter-book build doc/ | |
| # Upload Pages artifact | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: doc/_build/html | |
| # Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |