Skip to content

[Feat] Add condition of build_docs #8

[Feat] Add condition of build_docs

[Feat] Add condition of build_docs #8

Workflow file for this run

on:
pull_request:
types:
- closed
branches:
- docs
push:
branches:
- docs
name: Documentation (Build & Deployment)
jobs:
build:
runs-on: ubuntu-latest
env:
python-verison: '3.11'
strategy:
matrix:
language: [ 'en', 'ko' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '${{ env.python-verison }}'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[docs]
- name: Build
run: sphinx-build './docs/source' './docs/build/${{ matrix.language }}' -D language='${{ matrix.language }}'
- name: Store artifact (language = ${{ matrix.language }})
uses: actions/upload-artifact@v4
with:
name: docs-${{ matrix.language }}
path: ./docs/build/${{ matrix.language }}
integrate:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact (language = ko)
uses: actions/download-artifact@v4
with:
name: docs-ko
path: ./docs/build/ko
- name: Download artifact (language = en)
uses: actions/download-artifact@v4
with:
name: docs-en
path: ./docs/build/en
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload integrated artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/build/
deploy:
environment:
name: github-pages
url: '${{ steps.deployment.outputs.page_url }}/ko'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
needs: integrate
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4