Git Product home page Git Product logo

serv00_auto_run's Introduction

Serv00_Auto_Run

serv00自动启动脚本

run.sh

##创建run.sh脚本
cd ~
touch run.sh
chmod +x run.sh

##写入命令(或者自己复制进去):
cat << 'EOF' > run.sh
#!/bin/sh
~/.npm-global/bin/pm2 kill
pkill -kill -u 你的用户名
cd ~/domains && ~/.npm-global/bin/pm2 start ecosystem.config.js
~/.npm-global/bin/pm2 save
EOF

在 GitHub 仓库中,进入右上角Settings,在侧边栏找到Secrets and variables,点击展开选择Actions,点击New repository secret,然后创建一个名为SSH_PRIVATE_KEY的Secret,

获得私钥的命令:

# 生成新的 SSH 密钥对
ssh-keygen -t rsa -b 4096 -C "[email protected]"

# 将公钥添加到本地的 authorized_keys 文件中
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

# 查看私钥内容
cat ~/.ssh/id_rsa
#复制私钥内容作为SSH_PRIVATE_KEY的值,需要包括
#-----BEGIN OPENSSH PRIVATE KEY-----
#-----END OPENSSH PRIVATE KEY-----这两行

如下: image 在这里添加密钥,不用每次登录 (ssh的原理是把公钥存在serv00的服务器上,github的actions拿着私钥,经过公钥加密私钥解密的验证,双方就可以通信)

serv00_auto_run's People

Contributors

kuoihao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.