Skip to content

Commit e4d818b

Browse files
chore: Migrate github pages publishing to CircleCI
1 parent c3f3157 commit e4d818b

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.circleci/config.yml

+42
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,31 @@ jobs:
109109
name: Run GoReleaser
110110
command: goreleaser release --clean
111111

112+
book-build:
113+
executor: default
114+
environment:
115+
MISE_ENV: book
116+
steps:
117+
- checkout
118+
- install-dependencies
119+
- run:
120+
name: Build book
121+
command: just build-book
122+
- persist_to_workspace:
123+
root: ./docs
124+
paths:
125+
- book
126+
127+
book-publish:
128+
executor: default
129+
steps:
130+
- checkout
131+
- attach_workspace:
132+
at: /tmp/docs
133+
- utils/get-github-access-token
134+
- utils/github-pages-deploy:
135+
src-pages-dir: /tmp/docs/book
136+
112137
workflows:
113138
main:
114139
jobs:
@@ -118,6 +143,23 @@ workflows:
118143
- go-tests:
119144
context:
120145
- oplabs-rpc-urls
146+
147+
# To tighten the security, we split the workflow that publishes GitHub Pages
148+
# into two jobs and only expose the security context to the job that does the publishing
149+
#
150+
# The build job will run on every PR to avoid unpleasant surprises if the book build fails on main
151+
- book-build
152+
# The publish job will only run on the main branch
153+
- book-publish:
154+
filters:
155+
branches:
156+
only:
157+
- main
158+
requires:
159+
- book-build
160+
context:
161+
- circleci-repo-supersim
162+
121163
release:
122164
jobs:
123165
- go-release:

0 commit comments

Comments
 (0)