From 5941e7e27f0d2599add6a27f5bb77786e701434a Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751nss@gmail.com> Date: Fri, 13 Oct 2023 16:01:07 +0800 Subject: [PATCH] feat: test openim cicd Signed-off-by: Xinwei Xiong <3293172751nss@gmail.com> --- .github/workflows/build-ci.yaml | 32 +++++++++++++++++++++++++++++++ .github/workflows/main-ci.yaml | 34 +++++++++++++++++++++++++++++++++ README.md | 2 ++ 3 files changed, 68 insertions(+) create mode 100644 .github/workflows/build-ci.yaml create mode 100644 .github/workflows/main-ci.yaml diff --git a/.github/workflows/build-ci.yaml b/.github/workflows/build-ci.yaml new file mode 100644 index 0000000000..9e8d5f0a32 --- /dev/null +++ b/.github/workflows/build-ci.yaml @@ -0,0 +1,32 @@ +name: Documentation Deployment + +on: + push: + branches: + - main # Trigger the action on push events to the main branch + + +jobs: + build_and_deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Build documentation + run: npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build diff --git a/.github/workflows/main-ci.yaml b/.github/workflows/main-ci.yaml new file mode 100644 index 0000000000..86233a0e36 --- /dev/null +++ b/.github/workflows/main-ci.yaml @@ -0,0 +1,34 @@ +name: Pull Request Checks + +on: + pull_request: + branches: + - main # Trigger the action on pull requests to the main branch + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + + - name: Install dependencies + run: npm install + + - name: Build documentation + run: npm run build + + - name: Run tests + run: npm test # Replace with your test script if different + + - name: Lint check + run: npm run lint + + - name: Type checking + run: npm run typecheck diff --git a/README.md b/README.md index cff6576b31..829f55d8a3 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ To set up the documentation locally, follow these steps: ```bash npm run start ``` +At this point, you can access the local [http://localhost:3000](http://localhost:3000/) port. + In the `package.json` file, the `scripts` section provides various commands to help you work with the documentation: