54 lines
2.0 KiB
YAML
54 lines
2.0 KiB
YAML
name: local-test分支构建发布到本地服务器
|
|
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
|
on:
|
|
push:
|
|
branches:
|
|
- local-test
|
|
|
|
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 buildas local-test
|
|
tar czvf ./dist-local-test.tar.gz ./dist
|
|
- name: 打包发送到本地测试环境
|
|
uses: https://gitea.joylink.club/appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: ${{ secrets.LOCAL_233_SSH_HOST }}
|
|
username: ${{ secrets.LOCAL_233_SSH_USER }}
|
|
password: ${{ secrets.LOCAL_233_SSH_PASSWORD }}
|
|
port: ${{ secrets.LOCAL_233_SSH_PORT }}
|
|
source: ./dist-local-test.tar.gz
|
|
target: /home/minio/oss/rt-sim-training-client
|
|
overwrite: true
|
|
- name: SSH连接233并解压发布
|
|
uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
|
with:
|
|
host: ${{ secrets.LOCAL_233_SSH_HOST }}
|
|
port: ${{ secrets.LOCAL_233_SSH_PORT }}
|
|
username: ${{ secrets.LOCAL_233_SSH_USER }}
|
|
password: ${{ secrets.LOCAL_233_SSH_PASSWORD }}
|
|
script: |
|
|
cd /home/minio/oss/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-local-test.tar.gz
|
|
- run: echo "This job's status is ${{ job.status }}."
|