Skip to content

Refactor/103 refactor the aws clients (#104) #77

Refactor/103 refactor the aws clients (#104)

Refactor/103 refactor the aws clients (#104) #77

name: Deploy Documents
on:
push:
branches:
- main
- dev
permissions:
contents: write
jobs:
build-project-doc:
timeout-minutes: 3
name: build a project
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs/project
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Create a directory
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Install package
run: bun install
- name: Check format
run: bun run build --out-dir /build
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: project
path: /build
overwrite: true
retention-days: 1
build-top-page:
timeout-minutes: 1
name: build a top page
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs/top-page
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Create a directory
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Install package
run: bun install
- name: Check format
run: bun run build --out-dir /build/top-page
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: top-page
path: /build/top-page
overwrite: true
retention-days: 1
build-native-back-end-document:
timeout-minutes: 5
name: build the native back end app
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./app/src-tauri
steps:
- name: Checkout
uses: actions/checkout@v4
- name: mkdir
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Setup Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Build a document
run: cargo doc --all --no-deps --document-private-items --target-dir /build
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: native-back-end-document
path: /build
overwrite: true
retention-days: 1
build-web-api-app-doc:
timeout-minutes: 3
name: build a web API document
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lambdas/web-api-app
steps:
- name: Checkout
uses: actions/checkout@v4
- name: mkdir
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Setup Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: build
run: cargo doc --all --no-deps --document-private-items --target-dir /build
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: lambda-wab-api-app
path: /build
overwrite: true
retention-days: 1
build-s3-hook-doc:
timeout-minutes: 3
name: build a s3 hook document
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lambdas/s3-hook-app
steps:
- name: Checkout
uses: actions/checkout@v4
- name: mkdir
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Setup Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: build
run: cargo doc --all --no-deps --document-private-items --target-dir /build
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: lambda-s3-hook-app
path: /build
overwrite: true
retention-days: 1
build-crate-time-file-doc:
name: build a s3 hook document
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./crates/time_file_name
steps:
- name: Checkout
uses: actions/checkout@v4
- name: mkdir
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Setup Cargo
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: build
run: cargo doc --all --no-deps --document-private-items --target-dir /build
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: crate-time-file
path: /build
overwrite: true
retention-days: 1
build-native-front-document:
timeout-minutes: 1
name: build the native front-end app api doc
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./app
steps:
- name: Checkout
uses: actions/checkout@v4
- name: mkdir
run: sudo mkdir /build && sudo chmod -R 777 /build
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Install package
run: bun install
- name: Run TypeDoc
run: bun run typedoc
- name: move the document
run: cp -r ./docs/* /build
- name: Write an artifact
uses: actions/upload-artifact@v4
with:
name: native-front-end-document
path: /build
overwrite: true
retention-days: 1
deploy-document:
timeout-minutes: 3
name: Build top page document to make sure it can be built
runs-on: ubuntu-latest
needs:
- build-project-doc
- build-top-page
- build-native-back-end-document
- build-native-front-document
- build-web-api-app-doc
- build-crate-time-file-doc
- build-s3-hook-doc
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: mkdir
run: |
sudo mkdir /build && sudo chmod -R 777 /build
sudo mkdir /temp && sudo chmod -R 777 /temp
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: /temp
- name: Copy document to /build
run: |
mv /temp/project /build/project
mv /temp/top-page /build/top-page
mkdir -p /build/native/api/back-end && cp -r /temp/native-back-end-document/* /build/native/api/back-end
mkdir -p /build/native/api/front-end && cp -r /temp/native-front-end-document/* /build/native/api/front-end
mkdir -p /build/lambda/web-api && cp -r /temp/lambda-wab-api-app/* /build/lambda/web-api
mkdir -p /build/lambda/s3-hook && cp -r /temp/lambda-s3-hook-app/* /build/lambda/s3-hook
mkdir -p /build/crates/time-file && cp -r /temp/crate-time-file/* /build/crates/time-file
- name: copy top index.html
run: cp ./others/index.html /build
working-directory: ./docs
- name: mkdir for OpenAPI
run: mkdir -p /build/web-api
- name: build OpenAPI doc
run: bunx @redocly/cli@latest build-docs ./others/backend-api.yaml --output=/build/web-api/index.html
working-directory: ./docs
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: /build
token: ${{ secrets.GITHUB_TOKEN }}
action-timeline:
needs: [deploy-document]
runs-on: ubuntu-latest
steps:
- uses: Kesin11/actions-timeline@v2