Fix arch-cli command #78
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 }} |