Skip to content

deploy-book

deploy-book #37

Workflow file for this run

name: deploy-book
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Runs every day at midnight
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.
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build-and-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: environment.yml
activate-environment: pose-env
auto-activate-base: false
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Build the book
shell: bash -el {0}
env:
# Pass necessary secrets here
DISCOURSE_API_KEY: ${{ secrets.DISCOURSE_API_KEY }}
run: |
jupyter-book build .
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './_build/html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4