-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (69 loc) · 2.03 KB
/
deploy-github-pages.yml
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
# Copyright 2024 Remy Blank <[email protected]>
# SPDX-License-Identifier: MIT
name: Publish to GitHub Pages
on:
workflow_call:
inputs:
dev:
description: "When true, use t-doc/common at head for building."
type: boolean
required: false
jobs:
publish:
name: Publish to GitHub pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
concurrency:
group: pages
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Update system package index
run: sudo apt-get update
- name: Install system packages
run: |
sudo apt-get install --yes \
graphviz
- name: Install Python
id: python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Checkout t-doc/common repository
if: ${{ inputs.dev }}
uses: actions/checkout@v4
with:
repository: t-doc-org/common
ref: main
submodules: recursive
path: common
ssh-key: ${{ secrets.DEPLOY_COMMON }}
- name: Install t-doc/common package from checkout
if: ${{ inputs.dev }}
run: |
${{ steps.python.outputs.python-path }} -m pip install ./common
- name: Install t-doc/common package from PyPI
if: ${{ !inputs.dev }}
run: |
${{ steps.python.outputs.python-path }} -m pip install t-doc-common
- name: Checkout repository
uses: actions/checkout@v4
with:
path: repo
- name: Build HTML
run: |
tdoc --source=repo/docs --build=_build build html
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _build/html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4