Merge branch 'master' of http://120.46.212.6:3000/joylink/official-website
All checks were successful
master分支构建发布到公网服务器 / Build-Publish (push) Successful in 2m48s

This commit is contained in:
joylink_fanyuhong 2024-05-14 09:56:50 +08:00
commit c98bfdf0f8
3 changed files with 10552 additions and 0 deletions

View File

@ -0,0 +1,52 @@
name: master分支构建发布到公网服务器
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 czf ./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/official-website
overwrite: true
- name: SSH连接并解压发布
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/official-website
rm -rf /usr/local/joylink/client/official-website
mkdir -p /usr/local/joylink/client/official-website
tar xz --strip 2 -C /usr/local/joylink/client/official-website -f dist-master.tar.gz

View File

@ -1,5 +1,9 @@
# official-website # official-website
## 开发说明
- 开发在develop分支进行
- 当需要发布时merge 并 push到master分支会自动触发打包构建发布
## Project setup ## Project setup
``` ```
npm install npm install

10496
yarn.lock Normal file

File diff suppressed because it is too large Load Diff