Skip to content

Commit 51c49fd

Browse files
authored
feat: Publishes mdbook to Github Pages (#4343)
1 parent 458a29d commit 51c49fd

File tree

2 files changed

+75
-2
lines changed

2 files changed

+75
-2
lines changed

.github/workflows/usage_guide.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Publish Usage Guide
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
env:
11+
CDN: https://d3fqnyekunr9xg.cloudfront.net
12+
13+
# By default dependabot only receives read permissions. Explicitly give it write
14+
# permissions which is needed by the ouzi-dev/commit-status-updater task.
15+
#
16+
# Updating status is relatively safe (doesnt modify source code) and caution
17+
# should be taken before adding more permissions.
18+
permissions:
19+
contents: write
20+
statuses: write
21+
22+
jobs:
23+
build-deploy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout s2n-tls repo
27+
uses: actions/checkout@v4
28+
29+
- uses: dtolnay/rust-toolchain@stable
30+
31+
- name: Set override
32+
run: rustup override set stable
33+
34+
- uses: camshaft/install@v1
35+
with:
36+
crate: mdbook
37+
38+
- name: Build book
39+
run: |
40+
cd docs/usage-guide
41+
mdbook build
42+
43+
- name: Deploy documentation to gh-pages
44+
uses: JamesIves/[email protected]
45+
if: github.event_name == 'push'
46+
with:
47+
destination_dir: usage-guide
48+
publish_dir: docs/usage-guide/book
49+
50+
- name: Configure AWS credentials
51+
uses: aws-actions/[email protected]
52+
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
53+
with:
54+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
55+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
56+
aws-region: us-west-1
57+
58+
- name: Upload to S3
59+
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
60+
id: s3
61+
run: |
62+
TARGET="${{ github.sha }}/book"
63+
aws s3 sync docs/usage-guide/book "s3://s2n-tls-ci-artifacts/$TARGET" --acl private --follow-symlinks
64+
URL="$CDN/$TARGET/index.html"
65+
echo "URL=$URL" >> $GITHUB_OUTPUT
66+
67+
- name: Output mdbook url
68+
uses: ouzi-dev/[email protected]
69+
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
70+
with:
71+
name: "book / url"
72+
status: "success"
73+
url: "${{ steps.s3.outputs.URL }}"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ If you have any questions about submitting PRs, s2n-tls API usage, or something
4444

4545
## Documentation
4646

47-
s2n-tls uses [Doxygen](https://doxygen.nl/index.html) to document its public API. The latest s2n-tls documentation can be found on [GitHub pages](https://aws.github.io/s2n-tls/doxygen/). The [Usage Guide](docs/usage-guide/) explains how different TLS features can be configured and used.
47+
s2n-tls uses [Doxygen](https://doxygen.nl/index.html) to document its public API. The latest s2n-tls documentation can be found on [GitHub pages](https://aws.github.io/s2n-tls/doxygen/). The [Usage Guide](https://aws.github.io/s2n-tls/usage-guide/) explains how different TLS features can be configured and used.
4848

4949
Documentation for older versions or branches of s2n-tls can be generated locally. To generate the documentation, install doxygen and run `doxygen docs/doxygen/Doxyfile`. The doxygen documentation can now be found at `docs/doxygen/output/html/index.html`.
5050

@@ -77,7 +77,7 @@ int bytes_written;
7777
bytes_written = s2n_send(conn, "Hello World", sizeof("Hello World"), &blocked);
7878
```
7979

80-
For details on building the s2n-tls library and how to use s2n-tls in an application you are developing, see the [usage guide][Usage Guide](docs/usage-guide).
80+
For details on building the s2n-tls library and how to use s2n-tls in an application you are developing, see the [Usage Guide](https://aws.github.io/s2n-tls/usage-guide).
8181

8282
## s2n-tls features
8383

0 commit comments

Comments
 (0)