Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
.travis.yml 929 Bytes
Copy Edit Raw Blame History
蚂蚁 authored 2023-02-23 23:00 . ci(travis): 编辑监听分支
language: node_js
node_js:
- 12 #设置语言版本,
branches:
only:
- main #设置只监听哪个分支
cache:
apt: true
yarn: true
directories:
- node_modules #缓存依赖
before_install:
- openssl aes-256-cbc -K $encrypted_844372f51c48_key -iv $encrypted_844372f51c48_iv
-in id_rsa.enc -out ~/.ssh/id_rsa -d # id_rsa.enc加密的私钥
- chmod 600 ~/.ssh/id_rsa # 降低 id_rsa 文件的权限
- echo -e "Host 122.51.11.29\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config # 将生产服务器地址加入到测试机的信任列表中
install: # 安装依赖
- npm i
script: # 需要执行的脚本
- npm run build
- sed -i 's/\r//' deploy.sh
- bash ./deploy.sh
addons:
ssh_known_hosts: 122.51.11.29 # 添加 SSH 信任列表
after_success: # script 阶段成功时执行
# - scp -o stricthostkeychecking=no -r ./dist/* root@122.51.11.29:/home/www/blog # 使用scp拷贝到服务
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化