From 19b3965ab1c4698447eb34cced4877b714ce6eb5 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Tue, 14 Nov 2023 16:10:19 +0800 Subject: [PATCH] github actions. --- .github/workflows/deploy.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..e419775 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,28 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: "npm" + - run: npm install + - run: npm run build + + - uses: easingthemes/ssh-deploy@main + with: + SSH_PRIVATE_KEY: ${{ secrets.KEY }} + REMOTE_HOST: ${{ secrets.HOST }} + ARGS: "-avzr --delete" + SOURCE: docs/.vitepress/dist/ + REMOTE_USER: root + TARGET: /root/NewBook/dist