-
Notifications
You must be signed in to change notification settings - Fork 5
96 lines (82 loc) · 3.82 KB
/
quarto-pages.yml
File metadata and controls
96 lines (82 loc) · 3.82 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Render using Quarto and push to GH-pages
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Quarto
uses: quarto-dev/quarto-actions/install-quarto@v1
with:
# To install LaTeX to build PDF book
tinytex: false
# uncomment below and fill to pin a version
# version: 0.9.105
# Install any computing dependency you may need, usually either python and Jupyter or R
# More specific examples will be shared on quarto-dev/quarto-actions project
# plantUML can be used to dynamically generate UML diagrams to insert in model documentation
#
#- name: Install plantuml deps
# run: sudo apt-get install -y default-jre graphviz
#- name: Install plantuml
# run: wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/download/v1.2022.4/plantuml-1.2022.4.jar"
# this just inserts some information in the action log
- name: Whereami
run: pwd; ls -lah; java -version # java -jar plantuml.jar -version
- uses: actions/setup-python@v3
- name: "Install Python deps"
run: |
pip install -r requirements.txt
- name: "install pipx"
run: pip install pipx
- name: "install vocab_tools"
run: pipx install git+https://github.com/isamplesorg/vocab_tools.git@main
# 2024-08-15 smr, comment install from smrgeoinfo repo-- only difference seems to be in some comments in the code.
#run: pipx install git+https://github.com/smrgeoinfo/vocab_tools.git@main
# sets up python code to convert skos to markdown; code is run
# in generate_vocab_docs.sh
- name: Render book to all format
# Add any command line argument needed
#env:
# PLANTUML_BIN: "java -jar ${{ github.workspace }}/plantuml.jar"
# ttl to markdown python code is called from the generate_vocab_docs script
# Quarto render uses site configuration defined in the _quarto.yml file,
# individual page content in the web site is defined by various xxx.qmd files.
run: |
scripts/generate_vocab_docs.sh; quarto render
# Pre-deploy smoke gate (Option C). Loads the freshly-rendered
# docs/ in a headless browser and asserts the explorer is
# fundamentally alive (DuckDB-WASM inits, Cesium draws, a search
# returns results, no uncaught JS error). Fail-closed: if this
# step fails the job fails and the Deploy step below is skipped,
# so a JS-dead render never reaches isamples.org.
- name: Smoke test rendered site
run: |
pip install pytest playwright
playwright install --with-deps chromium
python -m http.server 8080 --directory docs &
SERVER_PID=$!
# Always reap the static server, even when pytest fails and
# `bash -e` aborts the script (GitHub's default shell). The
# non-zero exit still propagates -> step fails -> Deploy is
# skipped (fail-closed).
trap 'kill $SERVER_PID 2>/dev/null || true' EXIT
# Wait for the static server to accept connections.
for i in $(seq 1 30); do
curl -sf http://localhost:8080/explorer.html >/dev/null && break
sleep 1
done
ISAMPLES_BASE_URL=http://localhost:8080 \
pytest tests/test_smoke.py -s -q
- name: Deploy 🚀
# only deploy when push to main
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
# The branch the action should deploy to.
branch: gh-pages
# The folder the action should deploy. Adapt if you changed in Quarto config
folder: docs