Skip to content

Deploy JijModeling API #78

Deploy JijModeling API

Deploy JijModeling API #78

Workflow file for this run

name: GitHub Pages
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
book:
strategy:
matrix:
lang:
- ja
- en
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python and dependencies
run: |
uv python install 3.9
uv sync --all-extras --dev
- name: Build the book
run: |
uv run jupyter-book build docs/${{ matrix.lang }}
ERROR_LOGS=$(find docs/${{ matrix.lang }}/_build -type f -name "*.err.log")
if [ -n "$ERROR_LOGS" ]; then while IFS= read -r log; do echo "[ERROR LOG] $log" && cat "$log"; done <<< "$ERROR_LOGS" && exit 1; fi
- name: Upload HTML
uses: actions/upload-artifact@v4
with:
name: docs-${{ matrix.lang }}
path: ./docs/${{ matrix.lang }}/_build/html
retention-days: 30
package:
needs: book
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: API reference
run: |
mkdir -p package
mv apis package
- name: Setup redirect
run: mv docs/redirect/* package/
- name: Download HTML of docs
uses: actions/download-artifact@v4
with:
name: docs-ja
path: ./package/ja
- name: Download HTML of en
uses: actions/download-artifact@v4
with:
name: docs-en
path: ./package/en
- name: Upload Docs Package
uses: actions/upload-artifact@v4
with:
name: package
path: ./package
retention-days: 30
deploy:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
if: github.ref == 'refs/heads/main'
needs: package
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Download Docs Package
uses: actions/download-artifact@v4
with:
name: package
path: .
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "."
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4