From 76c3bcca17d0ba1153c075359715de5e06122755 Mon Sep 17 00:00:00 2001 From: Dristpunk Date: Thu, 7 Dec 2023 12:16:53 +0300 Subject: [PATCH] feat: copy action from hai --- .github/workflows/docs.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..a93f4c04 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,50 @@ +name: Deploy docs + +on: + push: + branches: + - main + - dev + +jobs: + deploy-docs: + if: github.repository == 'hai-on-op/hai' + name: Deploy docs + runs-on: ubuntu-latest + environment: + name: ${{ github.ref_name == 'main' && 'Prod' || 'Dev' }} + + steps: + - uses: actions/checkout@v3 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + + - name: Install dependencies + run: yarn --frozen-lockfile --network-concurrency 1 + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + + - name: Build Docs + run: yarn docs:build + + - name: Create book folder + run: mdbook build docs + + - uses: amondnet/vercel-action@v25 + with: + vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required + vercel-org-id: ${{ secrets.ORG_ID}} #Required + scope: ${{ secrets.ORG_ID}} #Required + vercel-args: ${{ github.ref_name == 'main' && '--prod' || '' }} + vercel-project-id: ${{ secrets.PROJECT_ID}} #Required + working-directory: ./docs/book