Skip to content

Update deployment

Update deployment #3

Workflow file for this run

name: docs-ci
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
test-blocks:
name: Test doc code blocks
runs-on: ubuntu-latest
continue-on-error: true
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
validate-multilingual-docs:
name: Validate multilingual metadata
runs-on: ubuntu-latest
steps:
- name: Checkout docs repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install validator deps
run: pip install pyyaml
- name: Run multilingual docs validation
run: python scripts/validate_multilingual_docs.py --strict-freshness
build-preview:
name: Build docs preview
runs-on: ubuntu-latest
needs:
- test-blocks
- validate-multilingual-docs
steps:
- name: Checkout docs repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Configure GitHub Pages
id: pages
uses: actions/configure-pages@v5
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Build Jekyll site
env:
JEKYLL_ENV: production
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
- name: Sanity-check Pages artifact
run: python scripts/check_pages_artifact.py --site-dir _site --base-path "${{ steps.pages.outputs.base_path }}"
- name: Upload preview artifact
uses: actions/upload-artifact@v4
with:
name: docs-preview-site
path: _site/
if-no-files-found: error