-
Notifications
You must be signed in to change notification settings - Fork 26
54 lines (47 loc) · 1.69 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
name: Build and Deploy Crate Docs to Vercel
on:
push:
branches: [main]
tags:
- v*.*.*
pull_request:
branches: [main]
jobs:
docs:
permissions:
contents: write
packages: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
runs-on:
- runs-on=${{ github.run_id }}
- runner=8cpu-linux-arm64
steps:
- uses: actions/checkout@v4
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@nightly
# TEMPORARY
- name: Give GitHub Actions access to private repositories
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GH_ACTIONS_DEPLOY_PRIVATE_KEY }}
- name: Build documentation
run: cargo doc --workspace --no-deps
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
# taken from https://github.com/paradigmxyz/reth/blob/main/.github/workflows/book.yml
RUSTDOCFLAGS: --cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options --html-in-header assets/head.html
# TODO: make a special tag for doc commit when pushing v*.*.* tags
- name: Install Vercel CLI
run: npm install -g vercel
- name: Deploy to Vercel
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} # Token stored in GitHub Secrets
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
run: |
cd target/doc
mkdir .vercel
echo "{\"projectId\":\"$VERCEL_PROJECT_ID\",\"orgId\":\"$VERCEL_ORG_ID\"}" > .vercel/project.json
vercel --prod --token $VERCEL_TOKEN