diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..6ca44e364d --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,60 @@ +# This is a basic workflow to help you get started with Actions +name: Build documentation + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: + - master + tags: + - '**' + pull_request: + branches: + - master + types: + - opened + - reopened + - synchronize + - closed + + # 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 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # otherwise, you will fail to push refs to dest repo + + - name: Install dependencies + run: + sudo apt-get update && sudo apt-get install -y g++ cmake ninja-build + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + + - name: Install jupedsim + run: | + pip install . + + - name: Build documentation + run: | + python3 -m pip install -r docs/requirements.txt + sphinx-build docs/source docs/build -j$(nproc) + + - name: Upload html pages as artifact + uses: actions/upload-artifact@v3 + with: + name: docs + path: | + docs/build/ diff --git a/.github/workflows/pr-docs.yml b/.github/workflows/pr-docs.yml deleted file mode 100644 index 4189856a46..0000000000 --- a/.github/workflows/pr-docs.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Deploy PR previews - -on: - pull_request: - types: - - opened - - reopened - - synchronize - - closed - -concurrency: preview-${{ github.ref }} - -jobs: - deploy-preview: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install dependencies - run: - sudo apt-get update && sudo apt-get install -y g++ cmake ninja-build - - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install jupedsim - run: | - pip install . - - - name: Build documentation - run: | - python3 -m pip install -r docs/requirements.txt - sphinx-build docs/source docs/build -j$(nproc) - - - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 - with: - source-dir: ./docs/build/