-
Notifications
You must be signed in to change notification settings - Fork 21
63 lines (54 loc) · 1.61 KB
/
deploy_website.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy Website
# Trigger the workflow on push events to the default branch (e.g., main)
on:
push:
branches:
- main
tags:
# Trigger on version tags (e.g., v1.0.0)
- "v*.*.*"
- "*.*.*"
# Trigger on pre-release tags (e.g., v1.0.0-alpha.1)
- "v*.*.*-*"
- "*.*.*-*"
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- main
# Allows you to manually trigger the workflow
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout the repository to get the code
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Pandoc
run: sudo apt-get install pandoc
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
# Install Python dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements_dev.txt
pip install -r doc/requirements.txt
# Build the Sphinx documentation
- name: Build Sphinx documentation
run: |
cd doc
make html
# Deploy to GitHub Pages
- name: GitHub Pages Action
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/_build/html
publish_branch: gh-pages
cname: procrustes.qcdevs.org