Skip to content

deploy-pages

deploy-pages #136

Workflow file for this run

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 book, 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: |
pip install --upgrade pip
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Build the book
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