Skip to content

Commit f406729

Browse files
authored
Create publish_docs_benches_to_ghpages.yaml
1 parent 5faeb10 commit f406729

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build and Publish Docs
2+
3+
on:
4+
pull_request:
5+
push:
6+
# branches: [ 'main' ] # the benches are heavy, so we want to run this only on-demand
7+
8+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
9+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
10+
concurrency:
11+
group: "pages"
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build_docs:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
- run: cargo doc
21+
- name: copy to output
22+
run: cp -r ./target/doc ./gh-pages
23+
- name: Save artifacts
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: bc-rust-docs
27+
path: ./target/doc
28+
run_benches:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
- run: cargo bench --all
34+
- name: Save artifacts
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: bc-rust-benches
38+
path: ./target/criterion
39+
collect_ghpages:
40+
needs: [build_docs, run_benches]
41+
runs-on: ubuntu-latest
42+
steps:
43+
- run: mkdir ./ghpages
44+
- name: Get docs from previous job
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: bc-rust-docs
48+
path: gh-pages/
49+
- name: Get benches from previous job
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: bc-rust-benches
53+
path: gh-pages/
54+
- name: Archive Compatibility Matrix For Download
55+
uses: actions/upload-pages-artifact@v3
56+
with:
57+
path: ./ghpages
58+
publish_to_gh_pages:
59+
needs: collect_ghpages
60+
if: github.ref == 'refs/heads/main'
61+
permissions:
62+
contents: read
63+
pages: write
64+
id-token: write
65+
environment:
66+
name: github-pages
67+
url: ${{ steps.deployment.outputs.page_url }}
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Update git pages with new compatibiliy matrix
71+
id: deployment
72+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)