Skip to content

Commit

Permalink
feat: Publishes mdbook to Github Pages (#4343)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddeleine authored Jan 8, 2024
1 parent 458a29d commit 51c49fd
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/usage_guide.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Publish Usage Guide
on:
push:
branches:
- main
pull_request:
branches:
- main

env:
CDN: https://d3fqnyekunr9xg.cloudfront.net

# By default dependabot only receives read permissions. Explicitly give it write
# permissions which is needed by the ouzi-dev/commit-status-updater task.
#
# Updating status is relatively safe (doesnt modify source code) and caution
# should be taken before adding more permissions.
permissions:
contents: write
statuses: write

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout s2n-tls repo
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- name: Set override
run: rustup override set stable

- uses: camshaft/install@v1
with:
crate: mdbook

- name: Build book
run: |
cd docs/usage-guide
mdbook build
- name: Deploy documentation to gh-pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
if: github.event_name == 'push'
with:
destination_dir: usage-guide
publish_dir: docs/usage-guide/book

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.1
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-1

- name: Upload to S3
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
id: s3
run: |
TARGET="${{ github.sha }}/book"
aws s3 sync docs/usage-guide/book "s3://s2n-tls-ci-artifacts/$TARGET" --acl private --follow-symlinks
URL="$CDN/$TARGET/index.html"
echo "URL=$URL" >> $GITHUB_OUTPUT
- name: Output mdbook url
uses: ouzi-dev/commit-status-updater@v2.0.1
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
name: "book / url"
status: "success"
url: "${{ steps.s3.outputs.URL }}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ If you have any questions about submitting PRs, s2n-tls API usage, or something

## Documentation

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.
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.

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`.

Expand Down Expand Up @@ -77,7 +77,7 @@ int bytes_written;
bytes_written = s2n_send(conn, "Hello World", sizeof("Hello World"), &blocked);
```

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).
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).

## s2n-tls features

Expand Down

0 comments on commit 51c49fd

Please sign in to comment.