Scicat update for 2024 #355
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-book | |
# Only run this when the master branch changes | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
# This job installs dependencies, builds the book, and pushes it to `gh-pages` | |
jobs: | |
deploy-book: | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 | |
steps: | |
- uses: actions/checkout@v4 | |
# Install dependencies | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- run: sudo apt install --yes graphviz graphviz-dev | |
- name: Install McStas | |
run: | | |
cd /etc/apt/sources.list.d | |
sudo wget https://packages.mccode.org/debian/mccode.list | |
sudo apt update | |
sudo apt install --yes mcstas-suite-python-ng=3.4 | |
cd ~ | |
MCRUN_DIR=$(dirname $(which mcrun)) | |
echo "MCRUN_DIR=$MCRUN_DIR" >> $GITHUB_ENV | |
mcstas-3.4-environment | |
echo $MCSTAS | |
- name: Install pip dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Configure mcstasscript | |
run: | | |
MCRUN_DIR=$(dirname $(which mcrun)) | |
python -c "import mcstasscript as ms; \ | |
my_configurator = ms.Configurator(); \ | |
my_configurator.set_mcrun_path('${MCRUN_DIR}'); \ | |
my_configurator.set_mcstas_path('/usr/share/mcstas/3.4/')" | |
# Build the book | |
- name: Build the book | |
run: | | |
jupyter-book build -W --keep-going . | |
# Make artifact visible in github actions | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dmsc-school-book | |
path: ./_build/html | |
# Push the book's HTML to github-pages | |
- name: GitHub Pages action | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/html | |
force_orphan: true | |
if: github.ref_name == 'main' |