From 7403e4829f7e3f5893161879eb2a6a7ac268e522 Mon Sep 17 00:00:00 2001 From: bytedream Date: Thu, 10 Aug 2023 14:12:37 +0200 Subject: [PATCH] add deploy action --- .gitea/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .gitea/workflows/deploy.yml diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..59f2990 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: delpoy + +on: + push: + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install dependencies + run: npm i + + - name: Build website + run: npm run build + + - name: Deploy + uses: cross-the-world/ssh-scp-ssh-pipelines@master + with: + host: 10.20.6.7 + port: 22 + user: root + key: ${{ secrets.SSH_KEY }} + first_ssh: | + rm -r /root/website + mkdir /root/website + scp: | + './build/*' => /root/website + './package*' => /root/website + last_ssh: | + cd /root/website + npm i --omit=dev + nohup node index.js > /var/log/website 2>&1