From 8f14ef55d08b604bd4706f9ea8c2675404cbe4e8 Mon Sep 17 00:00:00 2001 From: truongtop1 Date: Mon, 25 Nov 2024 13:56:38 +0700 Subject: [PATCH] ci: add documentation build script --- .github/workflows/doc.yml | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/doc.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..0a0d5d6 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,55 @@ +name: Documentation + +on: + push: + branches: [main] + paths-ignore: + - "!docs/**" + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Build documentation + run: | + cd docs + npm ci + npm run build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs/docs/.vitepress/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + needs: build + runs-on: ubuntu-latest + name: Deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file