Skip to content

Commit

Permalink
WIP: ci: configuration to build-deploy main docs to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Jan 28, 2024
1 parent a9097b8 commit 771f1d0
Showing 1 changed file with 108 additions and 0 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Documentation

on:
push:
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-main-documentation:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build documentation
run: |
cd docs/
make html
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: main-documentation
path: docs/_build/html

build-package-documentation:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main

- name: Pull latest Docker images
run: |
./src/docker/pull.sh
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true

- name: Build itk-wasm
run: |
pnpm build
consolidate-documentation:
needs: build-main-documentation
runs-on: ubuntu-22.04

steps:
- name: Download main documentation
uses: actions/download-artifact@v4
with:
name: main-documentation
path: docs

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs

deploy-gh-pages:
needs: consolidate-documentation
runs-on: ubuntu-22.04

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# with:
# preview: true <-> currently not available to the public

0 comments on commit 771f1d0

Please sign in to comment.