Skip to content

Commit e3b6b55

Browse files
Merge pull request #322 from ethereum-optimism/jan/circleci--004
chore: Migrate Github Pages publishing to CircleCI [4/N]
2 parents 83bcde8 + e4d818b commit e3b6b55

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

.circleci/config.yml

+43-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ executors:
77

88
orbs:
99
go: circleci/[email protected]
10-
utils: ethereum-optimism/[email protected].12
10+
utils: ethereum-optimism/[email protected].13
1111

1212
commands:
1313
# By default, CircleCI does not checkout any submodules
@@ -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)