deploy-pages #170
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: deploy-pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # paths: | |
| # - docs/** | |
| schedule: | |
| # https://crontab.guru/#00_00_*_*_2,4,6 | |
| # "At 00:00 on Tuesday, Thursday, and Saturday." | |
| # Time zone for GitHub is UTC, so adjust accordingly; -6 in the summer, -7 in the winter. | |
| # Therefore, this runs at 6:00 PM Mountain Time on Monday, Wednesday, and Friday. | |
| - cron: '00 00 * * 2,4,6' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| # This job installs dependencies, builds the site, and pushes it to `gh-pages` | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install graphviz graphviz-dev | |
| pip install --upgrade pip | |
| pip install -r requirements.txt | |
| # Build the Vue app first, and then move it to the docs/_static folder so that it's included | |
| # in the JupyterBook build. | |
| - name: Build the Vue app | |
| working-directory: ${{runner.workspace}}/WETOStack/entry_guide | |
| run: | | |
| npm install | |
| npm run build | |
| mv dist ../docs/_static/entry_guide | |
| - name: Build the JupyterBook | |
| working-directory: ${{runner.workspace}}/WETOStack/docs/ | |
| run: | | |
| jupyter-book build . | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ${{runner.workspace}}/WETOStack/docs/_build/html | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |