From 5801891fd68662555c11a75f0446f34f9034eadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8B=AE=E5=AD=90=E8=80=97=E8=80=97?= <3116737282@qq.com> Date: Wed, 6 Nov 2024 17:37:01 +0800 Subject: [PATCH] Create build.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 Github Action 进行项目部署 --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d7cb782 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: deploying-doc +run-name: Deploying doc —— ${{ github.run_id }} +on: + pull_request: + branches: main + types: + - closed + +jobs: + if_merged: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - name: 🚚 Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 9 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build doc + run: pnpm run docs:dev + + - name: 📂 Sync files + uses: SamKirkland/FTP-Deploy-Action@v4.3.5 + with: + server: ${{ secrets.FTP_SERVER_NAME }} + username: ${{ secrets.FTP_SERVER_USERNAME }} + password: ${{ secrets.FTP_SERVER_PASSWORD }} + local-dir: ./dist + server-dir: ./test + + \ No newline at end of file