@@ -4,149 +4,149 @@ import { checkoutStep } from "./lib/checkout.ts";
4
4
import { script } from "./lib/script.ts" ;
5
5
6
6
const build : WorkflowJob = {
7
- name : "Build documentation" ,
8
- "runs-on" : "ubuntu-latest" ,
9
- steps : [
10
- checkoutStep ( ) ,
11
- {
12
- " uses" :
"prefix-dev/[email protected] " ,
13
- " with" : {
14
- "pixi-version" : "latest" ,
15
- "activate-environment" : true ,
16
- " environments" : "doc" ,
17
- "cache-write" : false ,
18
- } ,
19
- } ,
20
- {
21
- "id" : "docs" ,
22
- " name" : "📚 Build documentation site" ,
23
- " run" : script ( "just docs" ) ,
24
- } ,
25
- {
26
- " name" : "📤 Package documentation site" ,
27
- " uses" : "actions/upload-artifact@v4" ,
28
- " with" : {
29
- " name" : "lenskit-docs" ,
30
- " path" : "build/doc" ,
31
- } ,
32
- } ,
33
- ] ,
7
+ name : "Build documentation" ,
8
+ "runs-on" : "ubuntu-latest" ,
9
+ steps : [
10
+ checkoutStep ( ) ,
11
+ {
12
+ uses :
"prefix-dev/[email protected] " ,
13
+ with : {
14
+ "pixi-version" : "latest" ,
15
+ "activate-environment" : true ,
16
+ environments : "doc" ,
17
+ "cache-write" : false ,
18
+ } ,
19
+ } ,
20
+ {
21
+ id : "docs" ,
22
+ name : "📚 Build documentation site" ,
23
+ run : script ( "just docs" ) ,
24
+ } ,
25
+ {
26
+ name : "📤 Package documentation site" ,
27
+ uses : "actions/upload-artifact@v4" ,
28
+ with : {
29
+ name : "lenskit-docs" ,
30
+ path : "build/doc" ,
31
+ } ,
32
+ } ,
33
+ ] ,
34
34
} ;
35
35
36
36
const archive : WorkflowJob = {
37
- name : "Archive documentation" ,
38
- "runs-on" : "ubuntu-latest" ,
39
- needs : [ "build" ] ,
40
- if : "github.event_name == 'push' || github.event_name == 'release'" ,
41
- environment : "docs" ,
42
- steps : [
43
- checkoutStep ( 1 ) ,
44
- {
45
- name : "Check out doc site" ,
46
- uses : "actions/checkout@v4" ,
47
- with : {
48
- repository : "lenskit/lenskit-docs" ,
49
- "ssh-key" : "${{ secrets.DOC_DEPLOY_KEY }}" ,
50
- path : "doc-site" ,
51
- ref : "version/latest" ,
52
- } ,
53
- } ,
54
- {
55
- name : "📥 Fetch documentation package" ,
56
- uses : "actions/download-artifact@v4" ,
57
- with : {
58
- name : "lenskit-docs" ,
59
- path : "build/doc" ,
60
- } ,
61
- } ,
62
- {
63
- name : "🛻 Copy documentation content" ,
64
- run : script (
65
- "rsync -av --delete --exclude=.git/ --exclude=.buildinfo --exclude=.doctrees build/doc/ doc-site/" ,
66
- "cd doc-site" ,
67
- "git config user.name 'LensKit Doc Bot'" ,
68
- "git config user.email '[email protected] '" ,
69
- "git add ." ,
70
- "git commit -m 'rebuild documentation'" ,
71
- ) ,
72
- } ,
73
- {
74
- name : "🛫 Push documentation" ,
75
- run : "cd doc-site && git push" ,
76
- } ,
77
- ] ,
37
+ name : "Archive documentation" ,
38
+ "runs-on" : "ubuntu-latest" ,
39
+ needs : [ "build" ] ,
40
+ if : "github.event_name == 'push' || github.event_name == 'release'" ,
41
+ environment : "docs" ,
42
+ steps : [
43
+ checkoutStep ( 1 ) ,
44
+ {
45
+ name : "Check out doc site" ,
46
+ uses : "actions/checkout@v4" ,
47
+ with : {
48
+ repository : "lenskit/lenskit-docs" ,
49
+ "ssh-key" : "${{ secrets.DOC_DEPLOY_KEY }}" ,
50
+ path : "doc-site" ,
51
+ ref : "version/latest" ,
52
+ } ,
53
+ } ,
54
+ {
55
+ name : "📥 Fetch documentation package" ,
56
+ uses : "actions/download-artifact@v4" ,
57
+ with : {
58
+ name : "lenskit-docs" ,
59
+ path : "build/doc" ,
60
+ } ,
61
+ } ,
62
+ {
63
+ name : "🛻 Copy documentation content" ,
64
+ run : script (
65
+ "rsync -av --delete --exclude=.git/ --exclude=.buildinfo --exclude=.doctrees build/doc/ doc-site/" ,
66
+ "cd doc-site" ,
67
+ "git config user.name 'LensKit Doc Bot'" ,
68
+ "git config user.email '[email protected] '" ,
69
+ "git add ." ,
70
+ "git commit -m 'rebuild documentation'" ,
71
+ ) ,
72
+ } ,
73
+ {
74
+ name : "🛫 Push documentation" ,
75
+ run : "cd doc-site && git push" ,
76
+ } ,
77
+ ] ,
78
78
} ;
79
79
80
80
const publish : WorkflowJob = {
81
- name : "Publish documentation" ,
82
- "runs-on" : "ubuntu-latest" ,
83
- needs : [ "archive" ] ,
84
- if : "github.event_name == 'push' || github.event_name == 'release'" ,
85
- environment : {
86
- name : "github-pages" ,
87
- url : "${{ steps.deployment.outputs.page_url }}" ,
81
+ name : "Publish documentation" ,
82
+ "runs-on" : "ubuntu-latest" ,
83
+ needs : [ "archive" ] ,
84
+ if : "github.event_name == 'push' || github.event_name == 'release'" ,
85
+ environment : {
86
+ name : "github-pages" ,
87
+ url : "${{ steps.deployment.outputs.page_url }}" ,
88
+ } ,
89
+ steps : [
90
+ {
91
+ name : "Check out doc site" ,
92
+ uses : "actions/checkout@v4" ,
93
+ with : {
94
+ repository : "lenskit/lenskit-docs" ,
95
+ ref : "main" ,
96
+ "fetch-depth" : 0 ,
97
+ } ,
88
98
} ,
89
- steps : [
90
- {
91
- name : "Check out doc site" ,
92
- uses : "actions/checkout@v4" ,
93
- with : {
94
- repository : "lenskit/lenskit-docs" ,
95
- ref : "main" ,
96
- "fetch-depth" : 0 ,
97
- } ,
98
- } ,
99
- {
100
- name : "🌳 Fix local git branches" ,
101
- run : script ( `
99
+ {
100
+ name : "🌳 Fix local git branches" ,
101
+ run : script ( `
102
102
for branch in $(git branch -r --list 'origin/version/*'); do
103
103
git branch -t \${branch##origin/} $branch
104
104
done
105
105
git branch -a
106
106
` ) ,
107
- } ,
108
- {
109
- name : "🛸 Set up Deno" ,
110
- uses : "denoland/setup-deno@v1" ,
111
- with : { "deno-version" : "~1.44" } ,
112
- } ,
113
- { name : "🧛🏼 Set up Just" , uses : "extractions/setup-just@v2" } ,
114
- { name : "Build site content" , run : "just build" } ,
115
- { name : "Setup Pages" , uses : "actions/configure-pages@v5" } ,
116
- {
117
- name : "📦 Upload artifact" ,
118
- uses : "actions/upload-pages-artifact@v3" ,
119
- with : { path : "site" } ,
120
- } ,
121
- {
122
- name : "🕸️ Deploy to GitHub Pages" ,
123
- id : "deployment" ,
124
- uses : "actions/deploy-pages@v4" ,
125
- } ,
126
- ] ,
127
- } ;
128
-
129
- export const workflow : Workflow = {
130
- name : "Documentation" ,
131
- on : {
132
- push : {
133
- branches : [ "main" ] ,
134
- } ,
135
- pull_request : { } ,
136
- workflow_dispatch : { } ,
137
107
} ,
138
- concurrency : {
139
- group : "doc-${{github.ref}}" ,
140
- "cancel-in-progress" : true ,
108
+ {
109
+ name : "🛸 Set up Deno" ,
110
+ uses : "denoland/setup-deno@v1" ,
111
+ with : { "deno-version" : "~1.44" } ,
112
+ } ,
113
+ { name : "🧛🏼 Set up Just" , uses : "extractions/setup-just@v2" } ,
114
+ { name : "Build site content" , run : "just build" } ,
115
+ { name : "Setup Pages" , uses : "actions/configure-pages@v5" } ,
116
+ {
117
+ name : "📦 Upload artifact" ,
118
+ uses : "actions/upload-pages-artifact@v3" ,
119
+ with : { path : "site" } ,
141
120
} ,
142
- permissions : {
143
- contents : "read " ,
144
- pages : "write " ,
145
- "id-token" : "write " ,
121
+ {
122
+ name : "🕸️ Deploy to GitHub Pages " ,
123
+ id : "deployment " ,
124
+ uses : "actions/deploy-pages@v4 " ,
146
125
} ,
147
- jobs : {
148
- build,
149
- archive,
150
- publish,
126
+ ] ,
127
+ } ;
128
+
129
+ export const workflow : Workflow = {
130
+ name : "Documentation" ,
131
+ on : {
132
+ push : {
133
+ branches : [ "main" ] ,
151
134
} ,
135
+ pull_request : { } ,
136
+ workflow_dispatch : { } ,
137
+ } ,
138
+ concurrency : {
139
+ group : "doc-${{github.ref}}" ,
140
+ "cancel-in-progress" : true ,
141
+ } ,
142
+ permissions : {
143
+ contents : "read" ,
144
+ pages : "write" ,
145
+ "id-token" : "write" ,
146
+ } ,
147
+ jobs : {
148
+ build,
149
+ archive,
150
+ publish,
151
+ } ,
152
152
} ;
0 commit comments