-
Notifications
You must be signed in to change notification settings - Fork 61
117 lines (117 loc) · 3.3 KB
/
docs.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
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
110
111
112
113
114
115
116
117
# GENERATED FILE, do not edit
# This file was generated with Typeline
# generated from: workflows/docs.ts
name: Documentation
'on':
push:
branches:
- main
pull_request: {}
workflow_dispatch: {}
concurrency:
group: 'doc-${{github.ref}}'
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
name: Build documentation
runs-on: ubuntu-latest
steps:
- name: "🛒 Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: prefix-dev/[email protected]
with:
pixi-version: latest
activate-environment: true
environments: doc
cache-write: false
log-level: vv
locked: false
frozen: true
- id: docs
name: "📚 Build documentation site"
run: |
just docs
- name: "📤 Package documentation site"
uses: actions/upload-artifact@v4
with:
name: lenskit-docs
path: build/doc
archive:
name: Archive documentation
runs-on: ubuntu-latest
needs:
- build
if: github.event_name == 'push' || github.event_name == 'release'
environment: docs
steps:
- name: "🛒 Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check out doc site
uses: actions/checkout@v4
with:
repository: lenskit/lenskit-docs
ssh-key: '${{ secrets.DOC_DEPLOY_KEY }}'
path: doc-site
ref: version/latest
- name: "📥 Fetch documentation package"
uses: actions/download-artifact@v4
with:
name: lenskit-docs
path: build/doc
- name: "🛻 Copy documentation content"
run: |
rsync -av --delete --exclude=.git/ --exclude=.buildinfo --exclude=.doctrees build/doc/ doc-site/
cd doc-site
git config user.name 'LensKit Doc Bot'
git config user.email '[email protected]'
git add .
git commit -m 'rebuild documentation'
- name: "🛫 Push documentation"
run: cd doc-site && git push
publish:
name: Publish documentation
runs-on: ubuntu-latest
needs:
- archive
if: github.event_name == 'push' || github.event_name == 'release'
environment:
name: github-pages
url: '${{ steps.deployment.outputs.page_url }}'
steps:
- name: Check out doc site
uses: actions/checkout@v4
with:
repository: lenskit/lenskit-docs
ref: main
fetch-depth: 0
- name: "🌳 Fix local git branches"
run: |
for branch in $(git branch -r --list 'origin/version/*'); do
git branch -t ${branch##origin/} $branch
done
git branch -a
- name: "🛸 Set up Deno"
uses: denoland/setup-deno@v1
with:
deno-version: ~1.44
- name: "🧛🏼 Set up Just"
uses: extractions/setup-just@v2
- name: Build site content
run: just build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: "📦 Upload artifact"
uses: actions/upload-pages-artifact@v3
with:
path: site
- name: "🕸️ Deploy to GitHub Pages"
id: deployment
uses: actions/deploy-pages@v4