From abdce5a30dceaab2bf206c423a5f1ae723e577d4 Mon Sep 17 00:00:00 2001 From: soul-walker Date: Tue, 26 Mar 2024 17:31:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D=20=E6=B7=BB=E5=8A=A0=E5=85=AC?= =?UTF-8?q?=E7=BD=91=E6=9E=84=E5=BB=BA=E5=8F=91=E5=B8=83=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...I_local_test.yaml => CICD_local_test.yaml} | 0 .gitea/workflows/CICD_master.yaml | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+) rename .gitea/workflows/{CI_local_test.yaml => CICD_local_test.yaml} (100%) create mode 100644 .gitea/workflows/CICD_master.yaml diff --git a/.gitea/workflows/CI_local_test.yaml b/.gitea/workflows/CICD_local_test.yaml similarity index 100% rename from .gitea/workflows/CI_local_test.yaml rename to .gitea/workflows/CICD_local_test.yaml diff --git a/.gitea/workflows/CICD_master.yaml b/.gitea/workflows/CICD_master.yaml new file mode 100644 index 000000000..fb74e349a --- /dev/null +++ b/.gitea/workflows/CICD_master.yaml @@ -0,0 +1,53 @@ +name: local-test分支构建发布到本地服务器 +run-name: ${{ gitea.actor }} is testing out Gitea Actions +on: + push: + branches: + - master + +jobs: + Build-Publish: + runs-on: joylink-local233 + steps: + - name: 检出代码 + uses: https://gitea.joylink.club/actions/checkout@v4 + with: + submodules: recursive + - name: 设置node环境 + uses: https://gitea.joylink.club/actions/local-setup-node@v0.1.1 + with: + version: 'v14.21.3' + cache: 'yarn' + cache-dependency-path: 'yarn.lock' + - name: 安装yarn,并build + run: | + node -v + npm config set registry https://registry.npmmirror.com + npm install --global yarn + yarn config set registry https://registry.npmmirror.com + yarn + yarn run build + tar czvf ./dist-master.tar.gz ./dist + - name: 打包发送到本地测试环境 + uses: https://gitea.joylink.club/appleboy/scp-action@v0.1.7 + with: + host: ${{ secrets.PUB1_DOMAIN_SSH_HOST }} + port: ${{ secrets.PUB1_DOMAIN_SSH_PORT }} + username: ${{ secrets.PUB1_DOMAIN_SSH_USER }} + password: ${{ secrets.PUB1_DOMAIN_SSH_PASSWORD }} + source: ./dist-master.tar.gz + target: /mnt/data/published/rt-sim-training-client + overwrite: true + - name: SSH连接233并解压发布 + uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.PUB1_DOMAIN_SSH_HOST }} + port: ${{ secrets.PUB1_DOMAIN_SSH_PORT }} + username: ${{ secrets.PUB1_DOMAIN_SSH_USER }} + password: ${{ secrets.PUB1_DOMAIN_SSH_PASSWORD }} + script: | + cd /mnt/data/published/rt-sim-training-client + rm -rf /usr/local/joylink/client/cbtc + mkdir -p /usr/local/joylink/client + tar xz --strip 2 -C /usr/local/joylink/client -f dist-master.tar.gz + - run: echo "This job's status is ${{ job.status }}."