Skip to content

Commit e281472

Browse files
committed
feat: Add injection code to the action
1 parent 93f6a3b commit e281472

File tree

1 file changed

+49
-38
lines changed

1 file changed

+49
-38
lines changed

.github/workflows/deploy-book.yml

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,52 @@ jobs:
1818
id-token: write
1919
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2020
steps:
21-
- uses: actions/checkout@v4
22-
23-
# Install dependencies
24-
- name: Set up Python
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version-file: .python-version
28-
cache: pip
29-
30-
- name: Install dependencies
31-
run: |
32-
pip install -r requirements.txt
33-
34-
# (optional) Cache your executed notebooks between runs
35-
# if you have config:
36-
# execute:
37-
# execute_notebooks: cache
38-
- name: cache executed notebooks
39-
uses: actions/cache@v4
40-
with:
41-
path: _build/.jupyter_cache
42-
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
43-
44-
# Build the book
45-
- name: Build the book
46-
run: |
47-
jupyter-book build .
48-
49-
# Upload the book's HTML as an artifact
50-
- name: Upload artifact
51-
uses: actions/upload-pages-artifact@v3
52-
with:
53-
path: "_build/html"
54-
55-
# Deploy the book's HTML to GitHub Pages
56-
- name: Deploy to GitHub Pages
57-
id: deployment
58-
uses: actions/deploy-pages@v4
21+
- uses: actions/checkout@v4
22+
23+
# Install dependencies
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version-file: .python-version
28+
cache: pip
29+
30+
- name: Install dependencies
31+
run: |
32+
pip install -r requirements.txt
33+
34+
# (optional) Cache your executed notebooks between runs
35+
# if you have config:
36+
# execute:
37+
# execute_notebooks: cache
38+
- name: cache executed notebooks
39+
uses: actions/cache@v4
40+
with:
41+
path: _build/.jupyter_cache
42+
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }}
43+
44+
# Build the book
45+
- name: Build the book
46+
run: |
47+
jupyter-book build .
48+
49+
- name: Inject all metadata into HTML
50+
run: |
51+
python -m quadriga.metadata.inject_all_metadata
52+
echo "Injected all metadata (OpenGraph, JSON-LD, and RDF links) into HTML head"
53+
54+
- name: Copy metadata files to build directory
55+
run: |
56+
cp metadata.jsonld _build/html/metadata.jsonld
57+
cp metadata.rdf _build/html/metadata.rdf
58+
echo "Copied metadata files to _build/html for discovery"
59+
60+
# Upload the book's HTML as an artifact
61+
- name: Upload artifact
62+
uses: actions/upload-pages-artifact@v3
63+
with:
64+
path: "_build/html"
65+
66+
# Deploy the book's HTML to GitHub Pages
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)