Skip to content

Commit

Permalink
docs: Configure for GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Dec 21, 2024
1 parent 569b237 commit 9603e79
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Deploy document'

on:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
deploy-docs:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- name: 'Configure dependencies'
run: |
uv sync --frozen --all-extras
- name: 'Build document'
run: |
task docs:build
- name: 'Upload artifact'
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/mini18n-dirhtml
- name: 'Deploy to GitHub Pages'
id: deployment
uses: actions/deploy-pages@v4
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Configuration for documents."""

import os

from atsphinx.bulma import __version__ as version

# -- Project information
Expand All @@ -10,6 +12,8 @@

# -- General configuration
extensions = [
# Bundled extensions
"sphinx.ext.githubpages",
"sphinx.ext.todo",
# My extensions
"atsphinx.mini18n",
Expand Down Expand Up @@ -58,4 +62,4 @@
mini18n_default_language = "en"
mini18n_support_languages = ["en", "ja"]
mini18n_select_lang_label = "Languages"
mini18n_basepath = "/bulma/"
mini18n_basepath = "/bulma/" if os.environ.get("GITHUB_PAGES") else "/"

0 comments on commit 9603e79

Please sign in to comment.