-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (89 loc) · 3.23 KB
/
Copy pathdeploy.yml
File metadata and controls
109 lines (89 loc) · 3.23 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
97
98
99
100
101
102
103
104
105
106
107
108
109
# Deploy multilingual docs to GitHub Pages.
#
# Jobs:
# 1. test-blocks — verify every executable doc code block runs correctly.
# 2. build-jekyll — build the Jekyll site.
# 3. deploy — publish _site/ to GitHub Pages.
#
# The interactive REPL and inline Run buttons execute code client-side via
# Pyodide (ProgramExecutor), so no server-side WASM bundle is required.
#
# Trigger: every push to main, or manually via workflow_dispatch.
name: Build and deploy docs
on:
push:
branches: [main]
workflow_dispatch:
# Required for the deploy-pages action.
permissions:
contents: read
pages: write
id-token: write
# Cancel in-progress runs on the same branch so pushes don't queue up.
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Job 1: Test every executable doc block ────────────────────────────────
test-blocks:
name: Test doc code blocks
runs-on: ubuntu-latest
steps:
- name: Checkout docs repo
uses: actions/checkout@v4
- name: Checkout multilingual source
uses: actions/checkout@v4
with:
repository: johnsamuelwrites/multilingual
path: multilingual-src
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip
cache-dependency-path: multilingual-src/pyproject.toml
- name: Install multilingual
working-directory: multilingual-src
run: pip install -e ".[dev]"
- name: Install pytest
run: pip install pytest
- name: Run code-block tests
run: pytest _tests/ -v --tb=short
# ── Job 2: Build Jekyll ───────────────────────────────────────────────────
build-jekyll:
name: Build Jekyll site
runs-on: ubuntu-latest
needs: test-blocks
steps:
- name: Checkout docs repo
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler-cache: true # runs `bundle install` and caches gems
- name: Configure GitHub Pages
id: pages
uses: actions/configure-pages@v5
# Jekyll is built with JEKYLL_ENV=production so jekyll-seo-tag,
# jekyll-sitemap, etc. output canonical URLs correctly.
- name: Build Jekyll site
env:
JEKYLL_ENV: production
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
- name: Upload Pages artefact
uses: actions/upload-pages-artifact@v3
with:
path: _site/
# ── Job 3: Deploy ─────────────────────────────────────────────────────────
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build-jekyll
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v4