-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (54 loc) · 1.72 KB
/
mdbook.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
# Sample workflow for building and deploying a mdBook site to AWS S3
#
# To get started with mdBook see: https://rust-lang.github.io/mdBook/index.html
#
name: Deploy mdBook to S3
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Build job
build-and-deploy:
runs-on: ubuntu-latest
env:
MDBOOK_VERSION: 0.4.36
MDBOOK_MERMAID_VERSION: 0.12.6
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: ${{ env.MDBOOK_VERSION }}
- name: Install mdbook-mermaid
run: |
cargo install mdbook-mermaid --version ${MDBOOK_MERMAID_VERSION}
- name: Build with mdBook
run: mdbook build
- name: Inject Static Pages
run: |
mkdir book/book
mv book/* book/book/ || true
cp static/* book/
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --delete
env:
AWS_REGION: 'us-east-1'
SOURCE_DIR: 'book'
AWS_S3_BUCKET: 'docs.arch.network'
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
- name: Invalidate CloudFront Distribution
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: E1KLTXFGPDK2XK
PATHS: "/*"
AWS_REGION: "us-east-1"
AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}