-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Migrate github pages deployment workflow to CircleCI (#507)
* chore: Migrate the github pages deploy flow * fix: PNPM * chore: Bump utils orb version * chore: Add context * debug: Pages * debug: Persisting * chore: Cleanup * debug: Branch * debug: Executor * chore: Remove debugging * chore: Move filters upstream * chore: Newline * chore: Add mise * fix: CircleCI config
- Loading branch information
1 parent
d543e3f
commit 4da71d9
Showing
4 changed files
with
112 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
slack: circleci/[email protected] | ||
parameters: | ||
ci_builder_image: | ||
type: string | ||
default: us-docker.pkg.dev/oplabs-tools-artifacts/images/ci-builder:v0.35.0 | ||
base_image: | ||
type: string | ||
default: ubuntu-2204:2022.07.1 | ||
utils: ethereum-optimism/[email protected] | ||
|
||
executors: | ||
default: | ||
machine: | ||
image: ubuntu-2204:2024.08.1 | ||
|
||
commands: | ||
install-dependencies: | ||
steps: | ||
- run: | ||
name: Install mise | ||
command: curl https://mise.run | MISE_INSTALL_PATH=/home/circleci/bin/mise sh | ||
- run: | ||
name: Activate mise | ||
command: echo 'eval "$(mise activate bash)"' >> $BASH_ENV | ||
- run: | ||
name: Install mise dependencies | ||
command: mise install | ||
|
||
notify-failures-on-develop: | ||
description: "Notify Slack" | ||
parameters: | ||
|
@@ -21,47 +34,81 @@ commands: | |
event: fail | ||
template: basic_fail_1 | ||
branch_pattern: develop | ||
|
||
jobs: | ||
lint-specs: | ||
docker: | ||
- image: <<pipeline.parameters.ci_builder_image>> | ||
executor: default | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install pnpm | ||
command: npm install -g [email protected] | ||
- run: | ||
name: Install deps | ||
command: just deps | ||
- install-dependencies | ||
- run: | ||
name: markdown lint | ||
command: just lint-specs-md-check | ||
- run: | ||
name: markdown toc | ||
command: just lint-specs-toc-check | ||
- run: | ||
name: build book | ||
command: just build | ||
|
||
lint-links: | ||
machine: | ||
image: <<pipeline.parameters.base_image>> | ||
executor: default | ||
steps: | ||
- checkout | ||
- install-dependencies | ||
- run: | ||
name: Lint check | ||
command: just lint-links | ||
- notify-failures-on-develop: | ||
channel: C055R639XT9 #notify-link-check | ||
|
||
build-book: | ||
executor: default | ||
steps: | ||
- checkout | ||
- install-dependencies | ||
- run: | ||
name: Build | ||
command: just build | ||
- run: | ||
name: Add CNAME file | ||
command: echo "specs.optimism.io" > ./book/html/CNAME | ||
- persist_to_workspace: | ||
root: ./book | ||
paths: | ||
- html | ||
|
||
publish-book: | ||
executor: default | ||
steps: | ||
- checkout | ||
- attach_workspace: | ||
at: /tmp/book | ||
- utils/get-github-access-token | ||
- utils/github-pages-deploy: | ||
src-pages-dir: /tmp/book/html | ||
|
||
workflows: | ||
specs-check: | ||
when: | ||
not: | ||
equal: [scheduled_pipeline, << pipeline.trigger_source >>] | ||
jobs: | ||
- lint-specs | ||
- build-book | ||
|
||
scheduled-links-check: | ||
when: | ||
equal: [build_daily, <<pipeline.schedule.name>>] | ||
jobs: | ||
- lint-links: | ||
context: slack | ||
|
||
publish: | ||
jobs: | ||
- build-book: | ||
filters: | ||
branches: | ||
only: main | ||
- publish-book: | ||
requires: | ||
- build-book | ||
context: | ||
- circleci-repo-specs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[tools] | ||
|
||
# Core dependencies | ||
rust = "1.83.0" | ||
just = "1.37.0" | ||
node = "20.9.0" | ||
|
||
# Cargo dependencies | ||
"cargo:mdbook" = "0.4.43" | ||
"cargo:mdbook-katex" = "0.9.2" | ||
"cargo:mdbook-linkcheck" = "0.7.7" | ||
"cargo:mdbook-mermaid" = "0.14.1" | ||
|
||
[hooks] | ||
postinstall = [ | ||
# Enabling corepack will install the `pnpm` package manager specified in package.json | ||
'npx corepack enable', | ||
'pnpm i --frozen-lockfile' | ||
] | ||
|
||
[settings] | ||
# Needs to be enabled for hooks to work | ||
experimental = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
"doctoc": "^2.2.1", | ||
"markdownlint-cli2": "0.4.0", | ||
"cspell": "^8.1.3" | ||
} | ||
}, | ||
"packageManager": "[email protected]" | ||
} |