Skip to content

Commit

Permalink
Merge pull request #253 from ericpre/reusable_workflow_push_doc
Browse files Browse the repository at this point in the history
Use reusable workflow to build and push documentation
  • Loading branch information
ericpre authored Apr 17, 2024
2 parents e47abc5 + f83ecc3 commit 084ec43
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 49 deletions.
65 changes: 16 additions & 49 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,21 @@ name: Documentation
on: [push, pull_request]

jobs:
build_doc:
Build:
# Use the "reusable workflow" from the hyperspy organisation
uses: hyperspy/.github/.github/workflows/doc.yml@main
with:
doc_build_path: './doc/build/html/'
pip_extra_doc: 'all,doc'
use_xvfb: true
check_links: false
SPHINXOPTS: ""

Push:
needs: Build
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'hyperspy' }}
permissions:
# needs write permission to push the docs to gh-pages
contents: write
name: Build doc
runs-on: ubuntu-latest
env:
DISPLAY: ':0'
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'

- name: Install Ubuntu packages for Qt
shell: bash
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
- name: Install Dependencies
run: |
pip install PyQt5 PyQtWebEngine
- name: Install
run: |
pip install -e .[doc]
- name: Build doc
run: |
sudo apt-get install xvfb
cd doc
xvfb-run make html
- uses: actions/upload-artifact@v4
with:
path: ./doc/build/*

- uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847
if: startsWith(github.ref, 'refs/tags/')
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/build/html
# Use the "reusable workflow" from the hyperspy organisation
uses: hyperspy/.github/.github/workflows/push_doc.yml@main
1 change: 1 addition & 0 deletions upcoming_changes/253.maintenance.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use reusable workflow from the HyperSpy organisation to build and push documentation.

0 comments on commit 084ec43

Please sign in to comment.