-
Notifications
You must be signed in to change notification settings - Fork 712
74 lines (63 loc) · 2.25 KB
/
usage_guide.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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
id-token: write # This is required for requesting the JWT/OIDC
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/[email protected]
if: github.event_name == 'push'
with:
target-folder: usage-guide
folder: docs/usage-guide/book
- name: Configure AWS credentials
uses: aws-actions/[email protected]
if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name
with:
role-to-assume: arn:aws:iam::024603541914:role/GitHubOIDCRole
role-session-name: s2ntlsghauseageguidesession
aws-region: us-west-2
- 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/[email protected]
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 }}"