diff --git a/.github/workflows/dispatch_opm_simulators.yml b/.github/workflows/dispatch_opm_simulators.yml new file mode 100644 index 000000000..c45608339 --- /dev/null +++ b/.github/workflows/dispatch_opm_simulators.yml @@ -0,0 +1,29 @@ +name: Dispatch to opm-python-documentation + +on: + push: + branches: master + paths: + - 'python/docstrings_simulators.json' + pull_request: + branches: master + paths: + - 'python/docstrings_simulators.json' + +jobs: + dispatch: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Send dispatch to opm-simulators + env: + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + curl -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository_owner }}/opm-python-documentation/dispatches \ + -d '{"event_type":"docstrings_simulators_updated"}' diff --git a/.github/workflows/python_sphinx_docs.yml b/.github/workflows/python_sphinx_docs.yml deleted file mode 100644 index 06caf423f..000000000 --- a/.github/workflows/python_sphinx_docs.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Build Python Sphinx Docs and push to gh-pages - -on: - push: - branches: main - paths: - - 'python/**' - - '.github/workflows/python_sphinx_docs.yml' - pull_request: - branches: main - paths: - - 'python/**' - - '.github/workflows/python_sphinx_docs.yml' -permissions: - contents: write -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: checkout source code - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history for all tags and branches - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - name: Install poetry - uses: abatilo/actions-poetry@v2 - - name: Install python dependencies - run: | - cd python/sphinx_docs - poetry install - - name: Build documentation - run: | - cd python - mkdir gh-pages - touch gh-pages/.nojekyll - cd sphinx_docs - # Currently we build only docs for the HEAD of the master branch - # Later we can add release tags to the list to get the docs for the releases - # For example: -b "main, release/2024.04/final" will build the docs for - # the main branch and the release/2024.04/final tag - poetry run sphinx-versioned -m master -b master --git-root ../../ - - name: Copy documentation to gh-pages - run: | - cp -r python/sphinx_docs/docs/_build/* gh-pages/ - - name: Deploy documentation - if: ${{ github.event_name == 'push' }} - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: gh-pages - folder: python/gh-pages