Update OpenJij Quickstart to use OMMX Adapter (#42) #133
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: 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@v5 | |
with: | |
enable-cache: true | |
python-version: 3.11 | |
- name: Set up Python and dependencies | |
run: | | |
uv sync --all-extras --dev | |
- name: Build the book | |
env: | |
GA4_TRACKING_ID: ${{ secrets.GA4_TRACKING_ID }} | |
run: | | |
# Replace GA4_TRACKING_ID placeholder with actual value from secrets | |
# Using | as delimiter to avoid issues with / in the GA4 ID | |
sed -i "s|GA4_TRACKING_ID|${GA4_TRACKING_ID}|g" docs/${{ matrix.lang }}/_config.yml | |
# Build the book | |
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 |