From d4767985a59e733f1b64980dabc3c1f4809ef51e Mon Sep 17 00:00:00 2001 From: Kenny Lajara Date: Tue, 25 Jun 2024 14:10:08 -0400 Subject: [PATCH] ci: update host_docs.yaml --- .github/workflows/host_docs.yaml | 78 ++++++++++++-------------------- 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/.github/workflows/host_docs.yaml b/.github/workflows/host_docs.yaml index 1b912d2..fe74287 100644 --- a/.github/workflows/host_docs.yaml +++ b/.github/workflows/host_docs.yaml @@ -1,61 +1,43 @@ -name: docs_pages_workflow - -# execute this workflow automatically when a we push to master +name: Build-sphinx-docs + +# Controls when the workflow will run on: - workflow_call: - workflow_dispatch: + # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] - -jobs: - - build_docs_job: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - + + # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Checkout - uses: actions/checkout@v2.3.4 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2.2.1 + - name: Set up Python 3.10 + uses: actions/setup-python@v2 with: - python-version: 3.9 - + python-version: "3.10" + - name: Install dependencies - run: | + run: | + python -m pip install --upgrade pip python -m pip install -U sphinx python -m pip install sphinx-rtd-theme - # python -m pip install sphinxcontrib-apidoc python -m pip install sphinx-autoapi python -m pip install myst_parser python -m pip install furo - - - name: make the sphinx docs - run: | - make -C docs clean - # sphinx-apidoc -f -o docs/source . -H Test -e -t docs/source/_templates - make -C docs html - - - name: Init new repo in dist folder and commit generated files - run: | - cd docs/build/html/ - git init - git branch -m master main - touch .nojekyll - git add -A - git config --local init.defaultBranch master - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git config --system --add safe.directory /github/workspace/docs/build/html - git commit -m 'deploy' - - - name: Force push to destination branch - uses: ad-m/github-push-action@v0.5.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - repository: kennylajara/wml-docs - branch: served - force: true - directory: ./docs/build/html + - name: Build HTML + run: | + cd docs/ + make html + - name: Run ghp-import + run: | + ghp-import -n -p -f docs/build/html